Skip to content

Commit 0e1bb14

Browse files
committed
feat: new mvn publish
1 parent 08bcda2 commit 0e1bb14

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

.github/workflows/mvn_publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
with:
2828
java-version: '8'
2929
distribution: 'zulu'
30-
server-id: ossrh
30+
server-id: central
3131
server-username: MAVEN_USERNAME
32-
server-password: MAVEN_PASSWORD
32+
server-password: MAVEN_CENTRAL_TOKEN
3333
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
3434
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
3535

3636
- name: Build with Maven
3737
run: mvn clean deploy --batch-mode -DskipTests -P release -B -U -e
3838
env:
3939
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
40-
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
40+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
4141
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

pom.xml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,9 @@
6363

6464
<distributionManagement>
6565
<repository>
66-
<id>ossrh</id>
67-
<url>https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/</url>
66+
<id>central</id>
67+
<url>https://central.sonatype.com/api/v1/publisher/deployments</url>
6868
</repository>
69-
<snapshotRepository>
70-
<id>ossrh</id>
71-
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
72-
</snapshotRepository>
7369
</distributionManagement>
7470

7571
<properties>
@@ -284,14 +280,13 @@
284280
<build>
285281
<plugins>
286282
<plugin>
287-
<groupId>org.sonatype.plugins</groupId>
288-
<artifactId>nexus-staging-maven-plugin</artifactId>
289-
<version>${nexus-staging-maven-plugin.version}</version>
283+
<groupId>org.sonatype.central</groupId>
284+
<artifactId>central-publishing-maven-plugin</artifactId>
285+
<version>0.4.0</version>
290286
<extensions>true</extensions>
291287
<configuration>
292-
<serverId>ossrh</serverId>
293-
<nexusUrl>https://ossrh-staging-api.central.sonatype.com/</nexusUrl>
294-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
288+
<publishingServerId>central</publishingServerId>
289+
<tokenAuth>true</tokenAuth>
295290
</configuration>
296291
</plugin>
297292
<plugin>

0 commit comments

Comments
 (0)