diff --git a/.github/workflows/maven-deploy.yml b/.github/workflows/maven-deploy.yml
new file mode 100644
index 0000000..ba388e8
--- /dev/null
+++ b/.github/workflows/maven-deploy.yml
@@ -0,0 +1,33 @@
+name: Publish package to the Maven Central Repository
+
+on:
+ release:
+ types: [published]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK 11
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ - name: Set up Apache Maven Central
+ uses: actions/setup-java@v4
+ with: # running setup-java again overwrites the settings.xml
+ distribution: 'temurin'
+ java-version: '11'
+ server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
+ server-username: MAVEN_USERNAME # env variable for username in deploy
+ server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
+ gpg-private-key: ${{ secrets.MAVEN_SIGNING_KEY }} # Value of the GPG private key to import
+ gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
+
+ - name: Publish to Apache Maven Central
+ run: mvn clean deploy -Dmaven.test.skip
+ env:
+ MAVEN_USERNAME: ${{ secrets.MVN_CENTRAL_USERNAME}}
+ MAVEN_CENTRAL_TOKEN: ${{ secrets.MVN_CENTRAL_PASSWORD }}
+ MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_SIGNING_KEY_PASSPHRASE }}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 2429afd..7080a32 100644
--- a/pom.xml
+++ b/pom.xml
@@ -186,7 +186,7 @@
sign
- 0x5F8EB601
+ A26C6169
diff --git a/templates/java/jersey2/pom.mustache b/templates/java/jersey2/pom.mustache
index 9d72831..43190ba 100644
--- a/templates/java/jersey2/pom.mustache
+++ b/templates/java/jersey2/pom.mustache
@@ -193,7 +193,7 @@
sign
- 0x5F8EB601
+ A26C6169