Skip to content

Commit

Permalink
Require JDK 17 at build time (fixes apache#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jul 25, 2024
1 parent c2d64f4 commit 18e7b01
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 186 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
java: [ '8' ]
os: [ ubuntu-latest ]
java: [ '17' ]
steps:
- uses: actions/checkout@v4

Expand All @@ -46,6 +46,11 @@ jobs:
restore-keys: |
${{ matrix.os }}-maven-
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: '3.9.8'

- name: Build with maven
run: mvn -B --errors --activate-profiles ci --no-transfer-progress package -DskipTests

Expand All @@ -63,7 +68,9 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
java-version: |
${{ matrix.java }}
17
- uses: actions/cache@v4
with:
Expand All @@ -72,9 +79,30 @@ jobs:
restore-keys: |
${{ matrix.os }}-maven-
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: '3.9.8'

- name: Build and test with maven
# Skip all static checks, they were already done in the compile jobs
run: mvn -B --errors --activate-profiles ci,jdk8 "-DjdkToolchainVersion=[,9)" --no-transfer-progress package
if: matrix.java == '8'

- name: Build and test with maven
# Skip all static checks, they were already done in the compile jobs
run: mvn -B --errors --activate-profiles ci "-DjdkToolchainVersion=[11,12)" --no-transfer-progress package
if: matrix.java == '11'

- name: Build and test with maven
# Skip all static checks, they were already done in the compile jobs
run: mvn -B --errors --activate-profiles ci "-DjdkToolchainVersion=[17,18)" --no-transfer-progress package
if: matrix.java == '17'

- name: Build and test with maven
# Skip all static checks, they were already done in the compile jobs
run: mvn -B --errors --activate-profiles ci --no-transfer-progress package
run: mvn -B --errors --activate-profiles ci "-DjdkToolchainVersion=[21,22)" --no-transfer-progress package
if: matrix.java == '21'

- name: Archive test results and logs
# if: success() || failure() to also get the test results on successful runs.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '8'
java-version: '17'
# Create a ~/.m2/settings.xml referencing these environment variable names
server-id: 'apache.snapshots.https'
server-username: NEXUS_USERNAME
Expand Down
2 changes: 2 additions & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-Dworkspace.root.dir=${session.rootDirectory}
-DprojectRoot=${session.rootDirectory}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Sensitive issues such as security vulnerabilities must be reported through [priv

# Core requirements

* Java 8+ (as of version 1.3)
* Java 8+ at runtime (as of version 2.3)
* Java 17+ at build time (as of version 2.14)

* [Slf4j](https://www.slf4j.org/)

Expand Down
Loading

0 comments on commit 18e7b01

Please sign in to comment.