From c6484258222c469b7f06f4c934d9d2ed980cbb37 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 7 Feb 2020 10:23:07 +0100 Subject: [PATCH] Ignore warnings for missing classpath elements with custom JAVA_HOME Prior to this commit, the "-Werror" was removed as a command-line argument in order not to fail the build for missing classpath elements. This commit reinstates "-Werror" and removes "-Xlink:path" in order to explicitly ignore warnings for missing classpath elements when executing the build with a custom JAVA_HOME. See gh-24474 --- gradle/custom-java-home.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gradle/custom-java-home.gradle b/gradle/custom-java-home.gradle index 0e523d2e1f..a9a41ae9c7 100644 --- a/gradle/custom-java-home.gradle +++ b/gradle/custom-java-home.gradle @@ -51,7 +51,9 @@ if (customJavaHome) { } options.fork = true options.forkOptions.executable = javacExecutable - options.compilerArgs -= "-Werror" + // Ignore warnings about missing classpath elements -- for example, those picked up + // via Class-Path entries in MANIFEST.MF files in artifacts like xalan-2.7.2.jar. + options.compilerArgs -= "-Xlint:path" if (customJavaSourceVersion) { options.compilerArgs += [ "--release", customJavaSourceVersion] inputs.property("customJavaSourceVersion", customJavaSourceVersion)