Skip to content

Commit 8787b29

Browse files
authored
Moved to use the Sonatype Central Portal (#141)
Signed-off-by: see-quick <[email protected]>
1 parent 53f9e26 commit 8787b29

File tree

4 files changed

+12
-25
lines changed

4 files changed

+12
-25
lines changed

.azure/scripts/push_to_nexus.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export GPG_TTY=$(tty)
1414
echo $GPG_SIGNING_KEY | base64 -d > signing.gpg
1515
gpg --batch --import signing.gpg
1616

17-
GPG_EXECUTABLE=gpg mvn $MVN_ARGS -DskipTests -s ./.azure/scripts/settings.xml -P ossrh verify deploy
17+
GPG_EXECUTABLE=gpg mvn $MVN_ARGS -DskipTests -s ./.azure/scripts/settings.xml -P central verify deploy
1818

1919
cleanup

.azure/scripts/settings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0">
22
<servers>
33
<server>
4-
<id>ossrh</id>
5-
<username>${env.NEXUS_USERNAME}</username>
6-
<password>${env.NEXUS_PASSWORD}</password>
4+
<id>central</id>
5+
<username>${env.CENTRAL_USERNAME}</username>
6+
<password>${env.CENTRAL_PASSWORD}</password>
77
</server>
88
</servers>
99
</settings>

.azure/templates/steps/push_artifacts.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ steps:
77
env:
88
GPG_PASSPHRASE: $(GPG_PASSPHRASE)
99
GPG_SIGNING_KEY: $(GPG_SIGNING_KEY)
10-
NEXUS_USERNAME: $(NEXUS_USERNAME)
11-
NEXUS_PASSWORD: $(NEXUS_PASSWORD)
10+
NEXUS_USERNAME: $(CENTRAL_USERNAME)
11+
NEXUS_PASSWORD: $(CENTRAL_PASSWORD)
1212
displayName: "Push artifacts to Nexus repository"
1313
condition: and(succeeded(), or(eq(variables.isMain, true), eq(variables.isTagBranch, true)), eq(${{ parameters.JDK_VERSION }}, '17'))

pom.xml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<maven.source-plugin.version>3.2.1</maven.source-plugin.version>
125125
<maven.checkstyle.version>3.5.0</maven.checkstyle.version>
126126
<maven.gpg.version>1.6</maven.gpg.version>
127-
<sonatype.nexus.staging>1.7.0</sonatype.nexus.staging>
127+
<central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
128128
<pit-junit-plugin.version>1.2.1</pit-junit-plugin.version>
129129
<pit-plugin.version>1.18.1</pit-plugin.version>
130130

@@ -138,17 +138,6 @@
138138
<skip.surefire.tests>${skipTests}</skip.surefire.tests>
139139
</properties>
140140

141-
<distributionManagement>
142-
<snapshotRepository>
143-
<id>ossrh</id>
144-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
145-
</snapshotRepository>
146-
<repository>
147-
<id>ossrh</id>
148-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
149-
</repository>
150-
</distributionManagement>
151-
152141
<dependencies>
153142
<!-- CODE DEPENDENCY -->
154143
<dependency>
@@ -464,7 +453,7 @@
464453

465454
<profiles>
466455
<profile>
467-
<id>ossrh</id>
456+
<id>central</id>
468457
<activation>
469458
<activeByDefault>false</activeByDefault>
470459
</activation>
@@ -498,14 +487,12 @@
498487
</executions>
499488
</plugin>
500489
<plugin>
501-
<groupId>org.sonatype.plugins</groupId>
502-
<artifactId>nexus-staging-maven-plugin</artifactId>
503-
<version>${sonatype.nexus.staging}</version>
490+
<groupId>org.sonatype.central</groupId>
491+
<artifactId>central-publishing-maven-plugin</artifactId>
492+
<version>${central-publishing-maven-plugin.version}</version>
504493
<extensions>true</extensions>
505494
<configuration>
506-
<serverId>ossrh</serverId>
507-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
508-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
495+
<publishingServerId>central</publishingServerId>
509496
</configuration>
510497
</plugin>
511498
</plugins>

0 commit comments

Comments
 (0)