Skip to content

Commit

Permalink
use java plugin instead of elasticsearch.java plugin to apply FIPS fo…
Browse files Browse the repository at this point in the history
…r test clusters
  • Loading branch information
jakelandis committed Aug 13, 2020
1 parent e719717 commit 5714e6d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions gradle/fips.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,7 @@ if (BuildParams.inFipsJvm) {
def bcFips = dependencies.create('org.bouncycastle:bc-fips:1.0.1')
def bcTlsFips = dependencies.create('org.bouncycastle:bctls-fips:1.0.9')

project.afterEvaluate {
def extraFipsJars = configurations.detachedConfiguration(bcFips, bcTlsFips)
// ensure that bouncycastle is on classpath for the all of test types, must happen in evaluateAfter since the rest tests explicitly
// set the class path to help maintain pure black box testing, and here we are adding to that classpath
tasks.withType(Test).configureEach { Test test ->
test.setClasspath(test.getClasspath().plus(extraFipsJars))
}
}

pluginManager.withPlugin('elasticsearch.java') {
pluginManager.withPlugin('java') {
TaskProvider<ExportElasticsearchBuildResourcesTask> fipsResourcesTask = project.tasks.register('fipsResources', ExportElasticsearchBuildResourcesTask)
fipsResourcesTask.configure {
outputDir = fipsResourcesDir
Expand All @@ -32,6 +23,15 @@ if (BuildParams.inFipsJvm) {
copy 'cacerts.bcfks'
}

project.afterEvaluate {
def extraFipsJars = configurations.detachedConfiguration(bcFips, bcTlsFips)
// ensure that bouncycastle is on classpath for the all of test types, must happen in evaluateAfter since the rest tests explicitly
// set the class path to help maintain pure black box testing, and here we are adding to that classpath
tasks.withType(Test).configureEach { Test test ->
test.setClasspath(test.getClasspath().plus(extraFipsJars))
}
}

pluginManager.withPlugin("elasticsearch.testclusters") {
afterEvaluate {
// This afterEvaluate hooks is required to avoid deprecated configuration resolution
Expand Down

0 comments on commit 5714e6d

Please sign in to comment.