Skip to content

Commit d33904e

Browse files
authored
Getting rid of direct cross-project dependencies to avoid gradle warnings (elastic#1868) (elastic#1869)
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 b94f95e commit d33904e

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
@@ -822,6 +822,12 @@ class BuildPlugin implements Plugin<Project> {
822822
commonItestTaskConfiguration(project, integrationTest)
823823
// TODO: Should this be the case? It is in Elasticsearch, but we may have to update some CI jobs?
824824
project.tasks.check.dependsOn(integrationTest)
825+
826+
Configuration itestJarConfig = project.getConfigurations().maybeCreate("itestJarConfig")
827+
itestJarConfig.canBeConsumed = Boolean.TRUE
828+
itestJarConfig.canBeResolved = Boolean.FALSE
829+
project.getArtifacts().add(itestJarConfig.getName(), itestJar)
830+
825831
return integrationTest
826832
}
827833

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)