Skip to content

Commit fc067ee

Browse files
authored
Switch to central-publishing-maven-plugin for publishing (#343)
1 parent 6aa2b0c commit fc067ee

File tree

5 files changed

+7
-39
lines changed

5 files changed

+7
-39
lines changed

.ci/settings.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
</pluginGroups>
77
<servers>
88
<server>
9-
<id>sonatype-nexus-snapshots</id>
10-
<username>${env.SERVER_USERNAME}</username>
11-
<password>${env.SERVER_PASSWORD}</password>
12-
</server>
13-
<server>
14-
<id>sonatype-nexus-staging</id>
9+
<id>central</id>
1510
<username>${env.SERVER_USERNAME}</username>
1611
<password>${env.SERVER_PASSWORD}</password>
1712
</server>

log4j-legacy-tests/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
<properties>
1313
<parent.base.dir>${project.basedir}/..</parent.base.dir>
14-
<maven-deploy-plugin.skip>true</maven-deploy-plugin.skip>
1514
</properties>
1615

1716
<dependencies>

log4j2-legacy-tests/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<properties>
1313
<version.log4j.legacy>2.6</version.log4j.legacy>
1414
<parent.base.dir>${project.basedir}/..</parent.base.dir>
15-
<maven-deploy-plugin.skip>true</maven-deploy-plugin.skip>
1615
</properties>
1716

1817
<dependencies>

logback-legacy-tests/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
<properties>
1313
<parent.base.dir>${project.basedir}/..</parent.base.dir>
14-
<maven-deploy-plugin.skip>true</maven-deploy-plugin.skip>
1514
</properties>
1615

1716
<dependencies>

pom.xml

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616
<module>log4j-legacy-tests</module>
1717
<module>logback-legacy-tests</module>
1818
<module>jul-ecs-formatter</module>
19-
<!-- IMPORTANT:
20-
For the nexus deployment to work correctly, the last project in the build order needs to have deployment
21-
enabled (maven-deploy-plugin.skip must be false).
22-
The reason is that for SNAPSHOT builds the upload is performed by the nexus-staging-maven-plugin
23-
after the last project build and EVERYTHING is skipped if this project is not part of the deployment.
24-
See the documentation (https://github.com/sonatype/nexus-maven-plugins/tree/main/staging/maven-plugin#plugin-flags)
25-
and the related issue (https://issues.sonatype.org/browse/NEXUS-9138).
26-
27-
You can verify the build order by executing ./mvnw clean and looking for the "Reactor Build Order log".
28-
-->
2919
</modules>
3020
<packaging>pom</packaging>
3121
<inceptionYear>2019</inceptionYear>
@@ -67,20 +57,8 @@
6757
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6858
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
6959
<parent.base.dir>${project.basedir}</parent.base.dir>
70-
<maven-deploy-plugin.skip>false</maven-deploy-plugin.skip>
7160
</properties>
7261

73-
<distributionManagement>
74-
<snapshotRepository>
75-
<id>sonatype-nexus-snapshots</id>
76-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
77-
</snapshotRepository>
78-
<repository>
79-
<id>sonatype-nexus-staging</id>
80-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
81-
</repository>
82-
</distributionManagement>
83-
8462
<profiles>
8563
<!--
8664
This profile is needed to be active in IntelliJ
@@ -137,16 +115,14 @@
137115
<version>2.16.2</version>
138116
</plugin>
139117
<plugin>
140-
<groupId>org.sonatype.plugins</groupId>
141-
<artifactId>nexus-staging-maven-plugin</artifactId>
118+
<groupId>org.sonatype.central</groupId>
119+
<artifactId>central-publishing-maven-plugin</artifactId>
120+
<version>0.8.0</version>
142121
<extensions>true</extensions>
143122
<configuration>
144-
<!-- The Base URL of Nexus instance where we want to stage -->
145-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
146-
<!-- The server "id" element from settings to use authentication from -->
147-
<serverId>sonatype-nexus-staging</serverId>
148-
<skipNexusStagingDeployMojo>${maven-deploy-plugin.skip}</skipNexusStagingDeployMojo>
149-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
123+
<publishingServerId>central</publishingServerId>
124+
<autoPublish>true</autoPublish>
125+
<excludeArtifacts>log4j-legacy-tests,log4j2-legacy-tests,logback-legacy-tests</excludeArtifacts>
150126
</configuration>
151127
</plugin>
152128
<plugin>

0 commit comments

Comments
 (0)