-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure Gradle build for use with newer JDKs #24474
Comments
Current work on this issue can be seen in the following feature branch: https://github.com/sbrannen/spring-framework/commits/issues/gh-24474-alternate-jdk-versions |
Also related to #24215 for proper Groovy support. |
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 spring-projectsgh-24474
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
Update: Support was added to the build in 8f02e10. A dedicated build plan for JDK 14 will follow on the CI server. |
Since the 1st build of the JDK 14 build plan passed on the CI server (https://build.spring.io/browse/SPR-JDK14-1), I am closing this issue. |
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
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
The aforementioned 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).
Examples:
|
OK. Thanks for the heads-up! |
Overview
In order to test the Spring Framework against newer versions of the JDK (e.g., early access builds for JDK 14, 15, etc.), we should introduce support in our Gradle build that allows us to select an alternative JDK (
JAVA_HOME
) to use when executing and/or compiling tests.Proposal
Introduce system properties that can control whether an alternative Java installation is to be used for the current build.
Investigate options available on the CI server (e.g., existing environment variables that point to JDK installations).
Notes
The Bamboo CI server has JDK 14ea installed in
/opt/jdk-14
. Moreover, installed JDKs available include/opt/jdk-[7-14]
.Related Issues
The text was updated successfully, but these errors were encountered: