diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0eb87ee6b..cfd26727c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 @@ -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: @@ -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. diff --git a/.github/workflows/master-build.yml b/.github/workflows/master-build.yml index 7aa899eb8..c4c8d995c 100644 --- a/.github/workflows/master-build.yml +++ b/.github/workflows/master-build.yml @@ -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 diff --git a/.mvn/maven.config b/.mvn/maven.config new file mode 100644 index 000000000..6f7ab7285 --- /dev/null +++ b/.mvn/maven.config @@ -0,0 +1,2 @@ +-Dworkspace.root.dir=${session.rootDirectory} +-DprojectRoot=${session.rootDirectory} diff --git a/README.md b/README.md index 906193ca8..b41afda43 100644 --- a/README.md +++ b/README.md @@ -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/) diff --git a/pom.xml b/pom.xml index fcbc28d7a..7e34e4233 100644 --- a/pom.xml +++ b/pom.xml @@ -79,18 +79,15 @@ - ${project.basedir} + 17 + [${minimalJavaBuildVersion},) + 3.9.8 + UTF-8 2024-06-20T20:44:27Z - - - - 1 - 8 8 - 1.0 - ${java.major.version}.${java.minor.version} + ${java.sdk.version} ${javac.source} ${javac.source} 1.10.12 @@ -137,10 +134,75 @@ - release + toolchains + + + jdkToolchainVersion + + + + + + org.apache.maven.plugins + maven-toolchains-plugin + 3.2.0 + + + load + validate + + select-jdk-toolchain + + + [${minimalJavaBuildVersion},) + Never + + + + pre-test + process-test-classes + + select-jdk-toolchain + + + ${jdkToolchainVersion} + Never + + + + + + + + + jdk8 - [1.8,1.9) + 8 + + + + net.revelc.code.formatter + formatter-maven-plugin + + + format + none + + + + + net.revelc.code + impsort-maven-plugin + + + sort-imports + none + + + + + @@ -318,21 +380,6 @@ - - - org.codehaus.gmavenplus - gmavenplus-plugin - [1.0,) - - compile - execute - testCompile - - - - - - org.apache.rat @@ -752,27 +799,6 @@ - - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.23 - - - org.codehaus.mojo.signature - java${java.major.version}${java.minor.version} - ${sniffer.signatures.version} - - - - - - org.codehaus.mojo.signature - java${java.major.version}${java.minor.version} - ${sniffer.signatures.version} - pom - - - org.apache.maven.plugins maven-scm-plugin @@ -844,56 +870,6 @@ - - org.codehaus.gmavenplus - gmavenplus-plugin - 3.0.2 - - - - org.apache.ant - ant - ${ant.version} - - - org.apache.ant - ant-launcher - ${ant.version} - - - org.apache.ant - ant-junit4 - ${ant.version} - - - org.apache.ant - ant-antlr - ${ant.version} - - - junit - junit - ${junit.version} - - - - org.apache.groovy - groovy - ${groovy.version} - - - org.apache.groovy - groovy-ant - ${groovy.version} - - - org.apache.ant - ant-junit - - - - - org.apache.maven.plugins maven-checkstyle-plugin @@ -1091,52 +1067,10 @@ java.,javax.,org.w3c.,org.xml.,junit. - - org.codehaus.mojo - build-helper-maven-plugin - ${build-helper-maven-plugin.version} - - - org.codehaus.gmavenplus - gmavenplus-plugin - - - - detect-workspace-root-dir - - validate - - execute - - - - - - - - - net.revelc.code.formatter formatter-maven-plugin @@ -1206,19 +1140,6 @@ - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - check-java-api - compile - - check - - - - org.apache.maven.plugins maven-enforcer-plugin @@ -1430,18 +1351,6 @@ ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - org.apache.maven - maven-archiver - ${maven.archiver.version} - - - org.codehaus.plexus - plexus-archiver - ${plexus.archiver.version} - - org.apache.maven.plugins @@ -1483,23 +1392,6 @@ - - - org.codehaus.mojo - build-helper-maven-plugin - - - remove-previous-artifact - clean - - remove-project-artifact - - - false - - - -