Fix for build runtime classpath instability (#45347)

(cherry picked from commit dee4ee2f0d4190ab54d0a4f0aa251d8c03e9db6d)
This commit is contained in:
Mark Vieira 2019-08-08 12:38:30 -07:00
parent a552b33276
commit 214cbb28df
No known key found for this signature in database
GPG Key ID: CA947EF7E6D4B105
2 changed files with 12 additions and 2 deletions

View File

@ -72,6 +72,7 @@ sourceSets {
} }
allprojects { allprojects {
apply plugin: 'java'
targetCompatibility = 11 targetCompatibility = 11
sourceCompatibility = 11 sourceCompatibility = 11
} }
@ -85,6 +86,13 @@ compileMinimumRuntimeJava {
sourceCompatibility = 8 sourceCompatibility = 8
} }
normalization {
runtimeClasspath {
// Ignore the embedded JAR as we track this separately below as a runtime dependency
ignore 'META-INF/*.jar'
}
}
jar { jar {
from sourceSets.minimumRuntime.output from sourceSets.minimumRuntime.output
into('META-INF') { into('META-INF') {
@ -143,6 +151,10 @@ if (project == rootProject) {
mavenLocal() mavenLocal()
} }
} }
dependencies {
// add this so the runtime classpath so Gradle will properly track it as a build runtime classpath input
runtimeOnly project('reaper')
}
// only run tests as build-tools // only run tests as build-tools
test.enabled = false test.enabled = false
} }

View File

@ -1,5 +1,3 @@
apply plugin: 'java'
jar { jar {
manifest { manifest {
attributes 'Main-Class': 'org.elasticsearch.gradle.reaper.Reaper' attributes 'Main-Class': 'org.elasticsearch.gradle.reaper.Reaper'