Skip to content

Switch to central-publishing-maven-plugin for publishing #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .ci/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
</pluginGroups>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.SERVER_USERNAME}</username>
<password>${env.SERVER_PASSWORD}</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<id>central</id>
<username>${env.SERVER_USERNAME}</username>
<password>${env.SERVER_PASSWORD}</password>
</server>
Expand Down
1 change: 0 additions & 1 deletion log4j-legacy-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

<properties>
<parent.base.dir>${project.basedir}/..</parent.base.dir>
<maven-deploy-plugin.skip>true</maven-deploy-plugin.skip>
</properties>

<dependencies>
Expand Down
1 change: 0 additions & 1 deletion log4j2-legacy-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<properties>
<version.log4j.legacy>2.6</version.log4j.legacy>
<parent.base.dir>${project.basedir}/..</parent.base.dir>
<maven-deploy-plugin.skip>true</maven-deploy-plugin.skip>
</properties>

<dependencies>
Expand Down
1 change: 0 additions & 1 deletion logback-legacy-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

<properties>
<parent.base.dir>${project.basedir}/..</parent.base.dir>
<maven-deploy-plugin.skip>true</maven-deploy-plugin.skip>
</properties>

<dependencies>
Expand Down
36 changes: 6 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@
<module>log4j-legacy-tests</module>
<module>logback-legacy-tests</module>
<module>jul-ecs-formatter</module>
<!-- IMPORTANT:
For the nexus deployment to work correctly, the last project in the build order needs to have deployment
enabled (maven-deploy-plugin.skip must be false).
The reason is that for SNAPSHOT builds the upload is performed by the nexus-staging-maven-plugin
after the last project build and EVERYTHING is skipped if this project is not part of the deployment.
See the documentation (https://github.com/sonatype/nexus-maven-plugins/tree/main/staging/maven-plugin#plugin-flags)
and the related issue (https://issues.sonatype.org/browse/NEXUS-9138).
You can verify the build order by executing ./mvnw clean and looking for the "Reactor Build Order log".
-->
</modules>
<packaging>pom</packaging>
<inceptionYear>2019</inceptionYear>
Expand Down Expand Up @@ -67,20 +57,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<parent.base.dir>${project.basedir}</parent.base.dir>
<maven-deploy-plugin.skip>false</maven-deploy-plugin.skip>
</properties>

<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<profiles>
<!--
This profile is needed to be active in IntelliJ
Expand Down Expand Up @@ -137,16 +115,14 @@
<version>2.16.2</version>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<!-- The Base URL of Nexus instance where we want to stage -->
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!-- The server "id" element from settings to use authentication from -->
<serverId>sonatype-nexus-staging</serverId>
<skipNexusStagingDeployMojo>${maven-deploy-plugin.skip}</skipNexusStagingDeployMojo>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<excludeArtifacts>log4j-legacy-tests,log4j2-legacy-tests,logback-legacy-tests</excludeArtifacts>
</configuration>
</plugin>
<plugin>
Expand Down
Loading