Skip to content

Commit 2e65ac8

Browse files
committed
Add central publishing
1 parent a6513f9 commit 2e65ac8

2 files changed

Lines changed: 10 additions & 38 deletions

File tree

.github/workflows/release-latest-version.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
with:
1414
java-version: '11'
1515
distribution: 'temurin'
16-
server-id: ossrh
17-
server-username: MAVEN_USERNAME
18-
server-password: MAVEN_PASSWORD
16+
server-id: central
17+
server-username: ${{ secrets.OSSRH_USERNAME }}
18+
server-password: ${{ secrets.OSSRH_TOKEN }}
1919
- id: install-secret-key
2020
name: Install gpg secret key
2121
run: |
@@ -26,6 +26,4 @@ jobs:
2626
gpg --list-secret-keys --keyid-format LONG
2727
- name: Publish package
2828
run: mvn -Prelease-sign-artifacts -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} --batch-mode deploy
29-
env:
30-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
31-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
29+

pom.xml

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
<version.maven-gpg-plugin>1.6</version.maven-gpg-plugin>
4747
<version.maven-javadoc-plugin>3.2.0</version.maven-javadoc-plugin>
4848
<version.maven-source-plugin>3.2.1</version.maven-source-plugin>
49-
<version.maven-deploy-plugin>3.0.0-M1</version.maven-deploy-plugin>
50-
<version.nexus-staging-maven-plugin>1.6.8</version.nexus-staging-maven-plugin>
5149
<version.maven-release-plugin>3.0.0-M1</version.maven-release-plugin>
5250
<version.maven-compiler-plugin>3.14.0</version.maven-compiler-plugin>
5351
</properties>
@@ -248,27 +246,14 @@
248246
</executions>
249247
</plugin>
250248
<plugin>
251-
<artifactId>maven-deploy-plugin</artifactId>
252-
<version>${version.maven-deploy-plugin}</version>
253-
<executions>
254-
<execution>
255-
<id>default-deploy</id>
256-
<phase>deploy</phase>
257-
<goals>
258-
<goal>deploy</goal>
259-
</goals>
260-
</execution>
261-
</executions>
262-
</plugin>
263-
<plugin>
264-
<groupId>org.sonatype.plugins</groupId>
265-
<artifactId>nexus-staging-maven-plugin</artifactId>
266-
<version>${version.nexus-staging-maven-plugin}</version>
249+
<groupId>org.sonatype.central</groupId>
250+
<artifactId>central-publishing-maven-plugin</artifactId>
251+
<version>0.7.0</version>
267252
<extensions>true</extensions>
268253
<configuration>
269-
<serverId>ossrh</serverId>
270-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
271-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
254+
<publishingServerId>central</publishingServerId>
255+
<autoPublish>true</autoPublish>
256+
<waitUntil>published</waitUntil>
272257
</configuration>
273258
</plugin>
274259
<plugin>
@@ -296,17 +281,6 @@
296281
</pluginManagement>
297282
</build>
298283

299-
<distributionManagement>
300-
<snapshotRepository>
301-
<id>ossrh</id>
302-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
303-
</snapshotRepository>
304-
<repository>
305-
<id>ossrh</id>
306-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
307-
</repository>
308-
</distributionManagement>
309-
310284
<issueManagement>
311285
<system>Github</system>
312286
<url>https://github.com/webcompere/java-test-gadgets/issues</url>

0 commit comments

Comments
 (0)