Skip to content

Commit bb20a44

Browse files
authored
Getting rid of direct cross-project dependencies to avoid gradle warnings (#1868)
This commit avoids gradle warnings when running ./gradlew :qa:kerberos:compileJava. The :qa:kerberos project had been directly pulling in the itest.runtimeClasspath from the storm and hadoop-mr projects, which is not allowed in gradle 8.
1 parent 38fd036 commit bb20a44

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

buildSrc/src/main/groovy/org/elasticsearch/hadoop/gradle/BuildPlugin.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,12 @@ class BuildPlugin implements Plugin<Project> {
817817
commonItestTaskConfiguration(project, integrationTest)
818818
// TODO: Should this be the case? It is in Elasticsearch, but we may have to update some CI jobs?
819819
project.tasks.check.dependsOn(integrationTest)
820+
821+
Configuration itestJarConfig = project.getConfigurations().maybeCreate("itestJarConfig")
822+
itestJarConfig.canBeConsumed = Boolean.TRUE
823+
itestJarConfig.canBeResolved = Boolean.FALSE
824+
project.getArtifacts().add(itestJarConfig.getName(), itestJar)
825+
820826
return integrationTest
821827
}
822828

qa/kerberos/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ dependencies {
8383
implementation("org.apache.hadoop:hadoop-client:${HadoopClusterConfiguration.HADOOP.defaultVersion()}")
8484
implementation("org.apache.spark:spark-sql_2.12:$project.ext.spark30Version")
8585

86-
implementation(project(":elasticsearch-hadoop-mr").sourceSets.itest.runtimeClasspath)
87-
implementation(project(":elasticsearch-storm").sourceSets.itest.runtimeClasspath)
86+
implementation( project(path: ':elasticsearch-hadoop-mr', configuration: 'itestJarConfig'))
87+
implementation( project(path: ':elasticsearch-storm', configuration: 'itestJarConfig'))
8888

8989
kdcFixture project(':test:fixtures:minikdc')
9090

0 commit comments

Comments
 (0)