diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5198f13..9aad586 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,16 +20,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 + - uses: actions/checkout@v4 + + - name: Set up JDK 17 for deploy to Sonatype + uses: actions/setup-java@v3 with: - java-version: 11 - distribution: 'temurin' - server-id: ossrh - server-username: OSSRH_USERNAME - server-password: OSSRH_PASSWORD - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + distribution: 'adopt' + java-version: 17 + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Verify with Maven @@ -49,10 +50,13 @@ jobs: - name: Source run: mvn -B -Prelease source:jar - - name: Publish to Apache Maven Central + - name: Prepare Maven environnement with Java 17 for deployment to Sonatype + run: export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED" + + - name: Publish to Sonatype Central if: github.ref == 'refs/heads/main' && github.event_name == 'push' - run: mvn -B -Prelease deploy + run: mvn -B -PsonatypeDeploy deploy env: - OSSRH_USERNAME: ${{ secrets.MAVEN_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index fb87d7c..d0e00ea 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.projectmanager @@ -33,6 +33,11 @@ + + + github + https://github.com/projectmgr/projectmanager-sdk-java/issues + UTF-8 @@ -61,91 +66,76 @@ - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - true - - ossrh - https://s01.oss.sonatype.org/ - true - + maven-compiler-plugin + 3.12.1 + - release + + sonatypeDeploy - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-sources - - + org.sonatype.central + central-publishing-maven-plugin + 0.5.0 + true + + central + true + true + published + org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 + maven-source-plugin + 3.3.0 - sign-artifacts - verify + attach-sources - sign + jar-no-fork - - - - --pinentry-mode - loopback - - - - - - - build-extras - - true - - - org.apache.maven.plugins - maven-source-plugin - 2.4 + maven-javadoc-plugin + 3.8.0 - attach-sources + attach-javadocs + + jar + org.apache.maven.plugins - maven-javadoc-plugin - 2.10.3 + maven-gpg-plugin + 3.2.5 - attach-javadocs + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + +