Fix deprecation warning in fips.gradle (#60802)
This commit is contained in:
parent
d593c963f3
commit
f8a63bbdb5
|
@ -5,13 +5,15 @@ import org.elasticsearch.gradle.testclusters.ElasticsearchCluster
|
|||
|
||||
// Common config when running with a FIPS-140 runtime JVM
|
||||
if (BuildParams.inFipsJvm) {
|
||||
|
||||
|
||||
allprojects {
|
||||
File fipsResourcesDir = new File(project.buildDir, 'fips-resources')
|
||||
boolean java8 = BuildParams.runtimeJavaVersion == JavaVersion.VERSION_1_8
|
||||
File fipsSecurity = new File(fipsResourcesDir, "fips_java${java8 ? '8' : ''}.security")
|
||||
File fipsPolicy = new File(fipsResourcesDir, "fips_java${java8 ? '8' : ''}.policy")
|
||||
File fipsTrustStore = new File(fipsResourcesDir, 'cacerts.bcfks')
|
||||
project.pluginManager.withPlugin('elasticsearch.java') {
|
||||
pluginManager.withPlugin('elasticsearch.java') {
|
||||
TaskProvider<ExportElasticsearchBuildResourcesTask> fipsResourcesTask = project.tasks.register('fipsResources', ExportElasticsearchBuildResourcesTask)
|
||||
fipsResourcesTask.configure {
|
||||
outputDir = fipsResourcesDir
|
||||
|
@ -19,17 +21,22 @@ if (BuildParams.inFipsJvm) {
|
|||
copy fipsPolicy.name
|
||||
copy 'cacerts.bcfks'
|
||||
}
|
||||
// This configuration can be removed once system modules are available
|
||||
configurations.create('extraFipsJars')
|
||||
dependencies {
|
||||
extraFipsJars 'org.bouncycastle:bc-fips:1.0.1'
|
||||
extraFipsJars 'org.bouncycastle:bctls-fips:1.0.9'
|
||||
}
|
||||
|
||||
|
||||
pluginManager.withPlugin("elasticsearch.testclusters") {
|
||||
testClusters.all {
|
||||
for (File dep : project.configurations.extraFipsJars.files) {
|
||||
extraJarFile dep
|
||||
afterEvaluate {
|
||||
// This afterEvaluate hooks is required to avoid deprecated configuration resolution
|
||||
// This configuration can be removed once system modules are available
|
||||
def extraFipsJars = configurations.detachedConfiguration(dependencies.create('org.bouncycastle:bc-fips:1.0.1'),
|
||||
dependencies.create('org.bouncycastle:bctls-fips:1.0.9'),
|
||||
)
|
||||
testClusters.all {
|
||||
extraFipsJars.files.each {
|
||||
extraJarFile it
|
||||
}
|
||||
}
|
||||
}
|
||||
testClusters.all {
|
||||
extraConfigFile "fips_java.security", fipsSecurity
|
||||
extraConfigFile "fips_java.policy", fipsPolicy
|
||||
extraConfigFile "cacerts.bcfks", fipsTrustStore
|
||||
|
|
Loading…
Reference in New Issue