Skip to content

Commit 214cbb2

Browse files
committed
Fix for build runtime classpath instability (#45347)
(cherry picked from commit dee4ee2)
1 parent a552b33 commit 214cbb2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

buildSrc/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ sourceSets {
7272
}
7373

7474
allprojects {
75+
apply plugin: 'java'
7576
targetCompatibility = 11
7677
sourceCompatibility = 11
7778
}
@@ -85,6 +86,13 @@ compileMinimumRuntimeJava {
8586
sourceCompatibility = 8
8687
}
8788

89+
normalization {
90+
runtimeClasspath {
91+
// Ignore the embedded JAR as we track this separately below as a runtime dependency
92+
ignore 'META-INF/*.jar'
93+
}
94+
}
95+
8896
jar {
8997
from sourceSets.minimumRuntime.output
9098
into('META-INF') {
@@ -143,6 +151,10 @@ if (project == rootProject) {
143151
mavenLocal()
144152
}
145153
}
154+
dependencies {
155+
// add this so the runtime classpath so Gradle will properly track it as a build runtime classpath input
156+
runtimeOnly project('reaper')
157+
}
146158
// only run tests as build-tools
147159
test.enabled = false
148160
}

buildSrc/reaper/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
apply plugin: 'java'
2-
31
jar {
42
manifest {
53
attributes 'Main-Class': 'org.elasticsearch.gradle.reaper.Reaper'

0 commit comments

Comments
 (0)