fix: correctly set Java version in maven and CI
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 087b6a5..eea5ba5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -49,7 +49,7 @@
java-version: ${{ matrix.java }}
distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }}
- name: Build
- run: mvn -B -e -Papache-release -Dgpg.skip=true verify
+ run: mvn -B -e -Papache-release -Dgpg.skip=true -Dmaven.compiler.release=${{ matrix.java }} verify
- name: Remove Snapshots
run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf
site:
@@ -72,7 +72,7 @@
java-version: ${{ env.BASE_JAVA_VERSION }}
distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }}
- name: Build
- run: mvn -B -e -Dmaven.test.skip=true package site-deploy
+ run: mvn -B -e -Dmaven.test.skip=true -Dmaven.compiler.release=${{ env.BASE_JAVA_VERSION }} package site-deploy
- name: Remove Snapshots
run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf
deploy:
@@ -102,7 +102,7 @@
server-username: NEXUS_USER
server-password: NEXUS_PW
- name: Deploy
- run: mvn -B -e -Papache-release -Dgpg.skip=true -Dmaven.test.skip=true deploy
+ run: mvn -B -e -Papache-release -Dgpg.skip=true -Dmaven.test.skip=true -Dmaven.compiler.release=${{ env.BASE_JAVA_VERSION }} deploy
env:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PW: ${{ secrets.NEXUS_PW }}
diff --git a/pom.xml b/pom.xml
index bd5a868..66dd4e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -507,7 +507,7 @@
http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html -->
<axis2_version>${project.version}</axis2_version>
<project.build.outputTimestamp>2025-03-04T22:45:29Z</project.build.outputTimestamp>
- <maven.compiler.target>11</maven.compiler.target>
+ <maven.compiler.release>17</maven.compiler.release>
</properties>
<dependencyManagement>