Skip to content

Commit

Permalink
Support building on JDK 17 (#1430)
Browse files Browse the repository at this point in the history
Provided a work-around suggested by the Spotless team to allow it to run successfully on JDK 17. This change allows developers to build Data Prepper using JDK 17. Updated the Spotless Gradle plugin, which also allows us to remove an older work-around related to cleaning the project root build directory. Updated the developer guide to clarify that Data Prepper can build with either JDK 11 or 17. Run the Gradle build and performance test builds on JDK 11 and 17 as part of the GitHub Actions CI.

Signed-off-by: David Venable <[email protected]>
  • Loading branch information
dlvenable authored Jun 1, 2022
1 parent 8ced533 commit bd389dd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:
strategy:
matrix:
java: [11]
java: [11, 17]

runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
strategy:
matrix:
java: [11]
java: [11, 17]

runs-on: ubuntu-latest

Expand Down
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ buildscript {
}

plugins {
id 'com.diffplug.spotless' version '6.1.0'
id 'com.diffplug.spotless' version '6.6.1'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
}

Expand Down Expand Up @@ -250,7 +250,3 @@ task generateThirdPartyReport(type: Copy) {
rename 'THIRD-PARTY-NOTICES.txt', 'THIRD-PARTY'
generateThirdPartyReport.dependsOn(generateLicenseReport)
}

task clean(type: Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion docs/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ First, please read our [contribution guide](../CONTRIBUTING.md) for more informa

### Java Versions

Building Data Prepper requires JDK 11. The Data Prepper Gradle build runs in a Java 11 JVM, but uses
Building Data Prepper requires JDK 11 or 17. The Data Prepper Gradle build runs in a Java 11 or 17 JVM, but uses
[Gradle toolchains](https://docs.gradle.org/current/userguide/toolchains.html) to compile the Java
code using Java 8. If you have a JDK 8 installed locally, Gradle will use your installed JDK 8. If you
do not, Gradle will install JDK 8.
Expand Down
9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@
#

version=1.5.0-SNAPSHOT

# Work-around for a Spotless Gradle issue:
# https://github.com/diffplug/spotless/issues/834#issuecomment-819118761
org.gradle.jvmargs=\
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

0 comments on commit bd389dd

Please sign in to comment.