Skip to content

Commit fc47e01

Browse files
authored
Fix dependency related deprecations (#58892) (#59123)
1 parent 80b8dc8 commit fc47e01

File tree

11 files changed

+30
-38
lines changed

11 files changed

+30
-38
lines changed

benchmarks/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ dependencies {
3737
api "org.openjdk.jmh:jmh-core:$versions.jmh"
3838
annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh"
3939
// Dependencies of JMH
40-
runtime 'net.sf.jopt-simple:jopt-simple:4.6'
41-
runtime 'org.apache.commons:commons-math3:3.2'
40+
runtimeOnly 'net.sf.jopt-simple:jopt-simple:4.6'
41+
runtimeOnly 'org.apache.commons:commons-math3:3.2'
4242
}
4343

4444
// enable the JMH's BenchmarkProcessor to generate the final benchmark classes

buildSrc/src/main/java/org/elasticsearch/gradle/ElasticsearchJavaPlugin.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,6 @@ public static void configureCompile(Project project) {
280280
compilerArgs.add(targetCompatibilityVersion.getMajorVersion());
281281
});
282282
});
283-
284-
project.getPluginManager().withPlugin("com.github.johnrengelman.shadow", plugin -> {
285-
// Ensure that when we are compiling against the "original" JAR that we also include any "shadow" dependencies on the compile
286-
// classpath
287-
Configuration shadowConfig = project.getConfigurations().getByName(ShadowBasePlugin.getCONFIGURATION_NAME());
288-
Configuration apiConfig = project.getConfigurations().getByName(JavaPlugin.API_ELEMENTS_CONFIGURATION_NAME);
289-
shadowConfig.getDependencies().all(dependency -> apiConfig.getDependencies().add(dependency));
290-
});
291283
}
292284

293285
/**

modules/lang-painless/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ sourceSets {
8484
}
8585

8686
dependencies {
87-
docCompile project(':server')
88-
docCompile project(':modules:lang-painless')
87+
docImplementation project(':server')
88+
docImplementation project(':modules:lang-painless')
8989
}
9090

9191
testClusters {

plugins/repository-hdfs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ dependencies {
7171
// Set the keytab files in the classpath so that we can access them from test code without the security manager
7272
// freaking out.
7373
if (isEclipse == false) {
74-
testRuntime files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab").parent)
74+
testRuntimeOnly files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab").parent)
7575
}
7676
}
7777

server/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ if (!isEclipse) {
4545
}
4646

4747
configurations {
48-
java11Compile.extendsFrom(api)
48+
java11Implementation.extendsFrom(api)
4949
}
5050

5151
dependencies {
52-
java11Compile sourceSets.main.output
52+
java11Implementation sourceSets.main.output
5353
}
5454

5555
compileJava11Java {
@@ -124,7 +124,7 @@ dependencies {
124124
api "org.elasticsearch:jna:${versions.jna}"
125125

126126
if (!isEclipse) {
127-
java11Compile sourceSets.main.output
127+
java11Implementation sourceSets.main.output
128128
}
129129

130130
testImplementation(project(":test:framework")) {

x-pack/plugin/sql/jdbc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies {
2525
}
2626
api project(':libs:elasticsearch-core')
2727
api "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}"
28-
runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
28+
runtimeOnly "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
2929
testImplementation project(":test:framework")
3030
testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts')
3131
}

x-pack/plugin/sql/qa/jdbc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ subprojects {
4444
}
4545
testImplementation project(":test:framework")
4646

47-
testRuntime project(path: xpackModule('sql:jdbc'))
47+
testRuntimeOnly project(path: xpackModule('sql:jdbc'))
4848
}
4949

5050
if (project.name != 'security') {

x-pack/plugin/sql/qa/server/build.gradle

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
api "org.jline:jline-reader:${jlineVersion}"
3131
api "org.jline:jline-style:${jlineVersion}"
3232

33-
testRuntime "org.elasticsearch:jna:${versions.jna}"
33+
testRuntimeOnly "org.elasticsearch:jna:${versions.jna}"
3434
}
3535

3636
/* disable unit tests because these are all integration tests used
@@ -55,7 +55,7 @@ subprojects {
5555
configurations.testRuntimeClasspath {
5656
resolutionStrategy.force "org.slf4j:slf4j-api:1.7.25"
5757
}
58-
configurations.testRuntime {
58+
configurations.testRuntimeOnly {
5959
// This is also required to make resolveAllDependencies work
6060
resolutionStrategy.force "org.slf4j:slf4j-api:1.7.25"
6161
}
@@ -70,35 +70,35 @@ subprojects {
7070
testImplementation project(":test:framework")
7171

7272
// JDBC testing dependencies
73-
testRuntime "net.sourceforge.csvjdbc:csvjdbc:${csvjdbcVersion}"
74-
testRuntime "com.h2database:h2:${h2Version}"
73+
testRuntimeOnly "net.sourceforge.csvjdbc:csvjdbc:${csvjdbcVersion}"
74+
testRuntimeOnly "com.h2database:h2:${h2Version}"
7575

7676
// H2GIS testing dependencies
77-
testRuntime("org.orbisgis:h2gis:${h2gisVersion}") {
77+
testRuntimeOnly("org.orbisgis:h2gis:${h2gisVersion}") {
7878
exclude group: "org.locationtech.jts"
7979
exclude group: "com.fasterxml.jackson.core"
8080
}
8181

82-
testRuntime project(path: xpackModule('sql:jdbc'))
83-
testRuntime xpackProject('plugin:sql:sql-client')
82+
testRuntimeOnly project(path: xpackModule('sql:jdbc'))
83+
testRuntimeOnly xpackProject('plugin:sql:sql-client')
8484

8585
// CLI testing dependencies
86-
testRuntime project(path: xpackModule('sql:sql-cli'))
87-
testRuntime(xpackProject('plugin:sql:sql-action')) {
86+
testRuntimeOnly project(path: xpackModule('sql:sql-cli'))
87+
testRuntimeOnly(xpackProject('plugin:sql:sql-action')) {
8888
transitive = false
8989
}
9090

91-
testRuntime("org.jline:jline-terminal-jna:${jlineVersion}") {
91+
testRuntimeOnly("org.jline:jline-terminal-jna:${jlineVersion}") {
9292
exclude group: "net.java.dev.jna"
9393
}
94-
testRuntime "org.jline:jline-terminal:${jlineVersion}"
95-
testRuntime "org.jline:jline-reader:${jlineVersion}"
96-
testRuntime "org.jline:jline-style:${jlineVersion}"
94+
testRuntimeOnly "org.jline:jline-terminal:${jlineVersion}"
95+
testRuntimeOnly "org.jline:jline-reader:${jlineVersion}"
96+
testRuntimeOnly "org.jline:jline-style:${jlineVersion}"
9797

98-
testRuntime "org.elasticsearch:jna:${versions.jna}"
98+
testRuntimeOnly "org.elasticsearch:jna:${versions.jna}"
9999

100100
// spatial dependency
101-
testRuntime project(path: xpackModule('spatial'))
101+
testRuntimeOnly project(path: xpackModule('spatial'))
102102
}
103103

104104
if (project.name != 'security') {

x-pack/plugin/sql/sql-action/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ dependencies {
2121
api xpackProject('plugin:sql:sql-proto')
2222
api "org.apache.lucene:lucene-core:${versions.lucene}"
2323
api "joda-time:joda-time:${versions.joda}"
24-
runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
25-
runtime "org.apache.logging.log4j:log4j-api:${versions.log4j}"
26-
runtime "org.apache.logging.log4j:log4j-core:${versions.log4j}"
24+
runtimeOnly "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
25+
runtimeOnly "org.apache.logging.log4j:log4j-api:${versions.log4j}"
26+
runtimeOnly "org.apache.logging.log4j:log4j-core:${versions.log4j}"
2727

2828
testImplementation project(":test:framework")
2929
}

x-pack/plugin/sql/sql-cli/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
api xpackProject('plugin:sql:sql-action')
3131
api project(":libs:elasticsearch-cli")
3232
api project(':libs:elasticsearch-x-content')
33-
runtime "org.elasticsearch:jna:${versions.jna}"
33+
runtimeOnly "org.elasticsearch:jna:${versions.jna}"
3434
testImplementation project(":test:framework")
3535
}
3636

x-pack/plugin/sql/sql-proto/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies {
1313
api( project(':libs:elasticsearch-x-content')) {
1414
transitive = false
1515
}
16-
runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
16+
runtimeOnly "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
1717

1818
testImplementation project(":test:framework")
1919
}

0 commit comments

Comments
 (0)