Skip to content

Commit dc8f08d

Browse files
committed
GH-166 - Switch to Maven Central for artifact deployment.
1 parent bd0425c commit dc8f08d

3 files changed

Lines changed: 15 additions & 13 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ jobs:
2323
cache: 'maven'
2424

2525
- name: Build and deploy snapshot
26-
run: ./mvnw -B deploy --file pom.xml -s settings.xml -DossrhUsername=${{ secrets.OSSRH_USERNAME }} -DossrhPassword=${{ secrets.OSSRH_PASSWORD }}
26+
env:
27+
CENTRAL_OSSRH_USERNAME: ${{ secrets.CENTRAL_OSSRH_USERNAME }}
28+
CENTRAL_OSSRH_PASSWORD: ${{ secrets.CENTRAL_OSSRH_PASSWORD }}
29+
run: ./mvnw -B deploy --file pom.xml -s settings.xml

pom.xml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,14 @@
102102
</configuration>
103103
</plugin>
104104
<plugin>
105-
<groupId>org.sonatype.plugins</groupId>
106-
<artifactId>nexus-staging-maven-plugin</artifactId>
107-
<version>1.7.0</version>
105+
<groupId>org.sonatype.central</groupId>
106+
<artifactId>central-publishing-maven-plugin</artifactId>
107+
<version>0.8.0</version>
108108
<extensions>true</extensions>
109109
<configuration>
110-
<serverId>sonatype-new</serverId>
111-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
112-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
113-
<keepStagingRepositoryOnFailure>true</keepStagingRepositoryOnFailure>
110+
<deploymentName>jMolecules ${project.version}</deploymentName>
111+
<publishingServerId>central-ossrh</publishingServerId>
112+
<autoPublish>true</autoPublish>
114113
</configuration>
115114
</plugin>
116115
</plugins>
@@ -224,8 +223,8 @@
224223

225224
<distributionManagement>
226225
<snapshotRepository>
227-
<id>ossrh</id>
228-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
226+
<id>central-ossrh</id>
227+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
229228
</snapshotRepository>
230229
</distributionManagement>
231230

settings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
44
<servers>
55
<server>
6-
<id>ossrh</id>
7-
<username>${ossrhUsername}</username>
8-
<password>${ossrhPassword}</password>
6+
<id>central-ossrh</id>
7+
<username>${env.CENTRAL_OSSRH_USERNAME}</username>
8+
<password>${env.CENTRAL_OSSRH_PASSWORD}</password>
99
</server>
1010
</servers>
1111
</settings>

0 commit comments

Comments
 (0)