Skip to content

Commit 8c9a774

Browse files
Merge pull request #230 from contentstack/fix/workflow-release
Update Maven workflow and versioning for publishing to Maven Central
2 parents b9a87e2 + fa029ff commit 8c9a774

File tree

2 files changed

+17
-24
lines changed

2 files changed

+17
-24
lines changed

.github/workflows/maven--package-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ jobs:
1616
with:
1717
java-version: '11'
1818
distribution: 'adopt'
19-
server-id: ossrh
19+
server-id: central
2020
server-username: MAVEN_USERNAME
2121
server-password: MAVEN_PASSWORD
2222
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
2323
gpg-passphrase: GPG_PASSPHRASE
2424
- name: Publish to Maven Central Repository
2525
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
2626
env:
27-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
28-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
27+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
28+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
2929
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3030

3131
# run: mvn --batch-mode deploy

pom.xml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,26 +85,24 @@
8585
</developer>
8686
</developers>
8787

88-
<distributionManagement>
88+
<!-- <distributionManagement>
8989
90-
<!-- Maven Snapshot Repository -->
90+
Maven Snapshot Repository
9191
<snapshotRepository>
9292
<id>ossrh</id>
9393
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
9494
</snapshotRepository>
95-
96-
<!--GitHub Packages-->
97-
<!-- <snapshotRepository>-->
98-
<!-- <id>github</id>-->
99-
<!-- <url>https://maven.pkg.github.com/contentstack/contentstack-java</url>-->
100-
<!-- </snapshotRepository>-->
101-
<!--Maven Release Repository-->
95+
<snapshotRepository>
96+
<id>github</id>
97+
<url>https://maven.pkg.github.com/contentstack/contentstack-java</url>
98+
</snapshotRepository>
99+
Maven Release Repository
102100
<repository>
103101
<id>ossrh</id>
104102
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
105103
</repository>
106104
107-
</distributionManagement>
105+
</distributionManagement> -->
108106

109107

110108
<dependencies>
@@ -328,19 +326,14 @@
328326
</plugin>
329327

330328
<plugin>
331-
<groupId>org.sonatype.plugins</groupId>
332-
<artifactId>nexus-staging-maven-plugin</artifactId>
333-
<version>${nexus-staging-maven-plugin.version}</version>
329+
<groupId>org.sonatype.central</groupId>
330+
<artifactId>central-publishing-maven-plugin</artifactId>
331+
<version>0.8.0</version> <!-- or latest -->
334332
<extensions>true</extensions>
335-
<!-- <configuration>-->
336-
<!-- <serverId>github</serverId>-->
337-
<!-- <nexusUrl>https://maven.pkg.github.com/contentstack/contentstack-java</nexusUrl>-->
338-
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>-->
339-
<!-- </configuration>-->
340333
<configuration>
341-
<serverId>ossrh</serverId>
342-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
343-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
334+
<publishingServerId>central</publishingServerId>
335+
<autoPublish>true</autoPublish>
336+
<waitUntil>published</waitUntil>
344337
</configuration>
345338
</plugin>
346339
<!--

0 commit comments

Comments
 (0)