From 214cbb28df282b87e68e73213c79aae936ce6dae Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Thu, 8 Aug 2019 12:38:30 -0700 Subject: [PATCH] Fix for build runtime classpath instability (#45347) (cherry picked from commit dee4ee2f0d4190ab54d0a4f0aa251d8c03e9db6d) --- buildSrc/build.gradle | 12 ++++++++++++ buildSrc/reaper/build.gradle | 2 -- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 8232ce63f23..b8a7411a956 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -72,6 +72,7 @@ sourceSets { } allprojects { + apply plugin: 'java' targetCompatibility = 11 sourceCompatibility = 11 } @@ -85,6 +86,13 @@ compileMinimumRuntimeJava { sourceCompatibility = 8 } +normalization { + runtimeClasspath { + // Ignore the embedded JAR as we track this separately below as a runtime dependency + ignore 'META-INF/*.jar' + } +} + jar { from sourceSets.minimumRuntime.output into('META-INF') { @@ -143,6 +151,10 @@ if (project == rootProject) { 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 test.enabled = false } diff --git a/buildSrc/reaper/build.gradle b/buildSrc/reaper/build.gradle index 242dfcafaaa..8613d049da2 100644 --- a/buildSrc/reaper/build.gradle +++ b/buildSrc/reaper/build.gradle @@ -1,5 +1,3 @@ -apply plugin: 'java' - jar { manifest { attributes 'Main-Class': 'org.elasticsearch.gradle.reaper.Reaper'