Commit Graph

6 Commits

Author SHA1 Message Date
Sam Brannen 7b94112ec6 Update documentation for custom-java-home.gradle
See gh-24719
2020-03-18 17:10:16 +01:00
Sam Brannen d481b81b7e Fix copy-n-paste error in custom_java_home.gradle script
See gh-24474
2020-02-12 23:08:42 +01:00
Sam Brannen de7bed2ab2 Simplify custom_java_home.gradle script
Setting `options.fork = true` causes the classpath in the forked
compiler process to include Class-Path entries from MANIFEST.MF files
in JARs in the classpath, which results in warnings about missing
classpath entries.

This commit removes the `options.fork = true` declaration and further
simplifies the script.

See gh-24474
2020-02-12 14:30:29 +01:00
Sam Brannen c648425822 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
2020-02-07 10:23:07 +01:00
Sam Brannen ce2c0e4c79 Credit @marcphilipp and @snicoll
See gh-24474
2020-02-06 15:32:51 +01:00
Sam Brannen 8f02e1088d Support alternate JDK versions in Gradle build
This commit adds support for the following two JVM system properties
that control the Gradle build for alternative JDKs (i.e., a JDK other
than the one used to launch the Gradle process).

- customJavaHome: absolute path to the alternate JDK installation to
  use to compile Java code and execute tests. Setting this system
  property causes Groovy 3.0 RC3 to be used instead of 2.5.x. This
  system property is also used in spring-oxm.gradle to determine
  whether JiBX is supported.

- customJavaSourceVersion: Java version supplied to the `--release`
  command line flag to control the Java source and target compatibility
  version. Supported versions include 9 or higher. Do not set this
  system property if Java 8 should be used.

Examples:

./gradlew -DcustomJavaHome=/opt/java/jdk-14 test

./gradlew --no-build-cache -DcustomJavaHome=/opt/java/jdk-14 test

./gradlew -DcustomJavaHome=/opt/java/jdk-14 -DcustomJavaSourceVersion=14 test

See gh-24474
2020-02-06 15:24:19 +01:00