-
Notifications
You must be signed in to change notification settings - Fork 19
Bump build requirement to JDK 17 #178
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,21 +2,36 @@ name: Maven CI | |
|
|
||
| on: [push, pull_request] | ||
|
|
||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| build: | ||
| strategy: | ||
| matrix: | ||
| os: [ ubuntu-latest ] | ||
| java-version: [ 8 ] | ||
| java-version: [ 17 ] | ||
| distro: [ 'zulu', 'temurin' ] | ||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| steps: | ||
| - uses: actions/[email protected] | ||
| - name: Set up JDK ${{ matrix.java-version }} | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/[email protected] | ||
|
|
||
| - name: Set up JDK 8 and ${{ matrix.java-version }} | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: ${{ matrix.distro }} | ||
| java-version: ${{ matrix.java-version }} | ||
| # We install two JDKs: | ||
| # * The first one is used by tests through Maven Toolchains. | ||
| # * The second one is used by Maven itself to perform the build. | ||
| # | ||
| # WARNING: The order matters. | ||
| # The last version specified will be assigned to JAVA_HOME. | ||
| java-version: | | ||
| 8 | ||
| ${{ matrix.java-version }} | ||
|
|
||
| - name: Build with Maven | ||
| run: mvn package --file pom.xml | ||
| shell: bash | ||
| run: mvn verify | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 17 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --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.main=ALL-UNNAMED | ||
| --add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED | ||
| --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED | ||
| --add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED | ||
| --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED | ||
| --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED | ||
| --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand this profile. If the build requires Java 17, how could this be activated and work? What am I missing?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of this profile is to run tests using JRE 8 in forked JVMs.
Since this can be only done through Maven Toolchains, which might be hard to configure for single-time contributors, the profile only activates if a toolchains configuration is present.
Note that the CI always has a toolchains configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it - I've never set the Maven Toolchain up. Thanks for the explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't really used it either, but since GitHub automatically sets up the file, it's pretty painless.
I think this pull request makes it so that it's not required (presumably, the CI will test Java 8 if the developer does not), but if you're interested, it has a mojo to automatically try to generate the config file
mvn toolchains:generate-jdk-toolchains-xml.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! 💯
It discovered all 8 JDKs installed on my system.