Skip to content

Commit 8ee34b9

Browse files
authored
Switch to nexus plugin for releases (#235)
1 parent 8344327 commit 8ee34b9

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

pom.xml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,21 @@
1111
<module>log4j-ecs-layout</module>
1212
<module>log4j2-ecs-layout</module>
1313
<module>logback-ecs-encoder</module>
14-
<module>jul-ecs-formatter</module>
1514
<module>jboss-logmanager-ecs-formatter</module>
1615
<module>log4j2-legacy-tests</module>
1716
<module>log4j-legacy-tests</module>
1817
<module>logback-legacy-tests</module>
18+
<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+
-->
1929
</modules>
2030
<packaging>pom</packaging>
2131
<inceptionYear>2019</inceptionYear>
@@ -127,9 +137,16 @@
127137
<version>2.16.2</version>
128138
</plugin>
129139
<plugin>
130-
<artifactId>maven-deploy-plugin</artifactId>
140+
<groupId>org.sonatype.plugins</groupId>
141+
<artifactId>nexus-staging-maven-plugin</artifactId>
142+
<extensions>true</extensions>
131143
<configuration>
132-
<skip>${maven-deploy-plugin.skip}</skip>
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>
133150
</configuration>
134151
</plugin>
135152
<plugin>
@@ -297,8 +314,9 @@
297314
<version>2.5.3</version>
298315
</plugin>
299316
<plugin>
300-
<artifactId>maven-deploy-plugin</artifactId>
301-
<version>2.8.2</version>
317+
<groupId>org.sonatype.plugins</groupId>
318+
<artifactId>nexus-staging-maven-plugin</artifactId>
319+
<version>1.6.13</version>
302320
</plugin>
303321
<plugin>
304322
<groupId>org.codehaus.mojo</groupId>

0 commit comments

Comments
 (0)