Skip to content

Commit aa19e4d

Browse files
committed
chore(release): Update to Maven central portal release
- Use Maven central portal instead of deprecated OSSRH plugins - Adjust release scripts to publish to Maven Central portal
1 parent bbbba91 commit aa19e4d

File tree

6 files changed

+20
-92
lines changed

6 files changed

+20
-92
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ release-major:
3434
./scripts/citrus release --git-remote $(RELEASE_GIT_REMOTE) --major-release --release-version $(VERSION)
3535

3636
release-dry-run:
37-
./scripts/citrus release --git-remote $(RELEASE_GIT_REMOTE) --release-version $(VERSION) --skip-tests --dry-run --no-git-push --keep-staging-repo
37+
./scripts/citrus release --git-remote $(RELEASE_GIT_REMOTE) --release-version $(VERSION) --skip-tests --dry-run --no-git-push

citrus-remote-sample/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@
4141
<build>
4242
<plugins>
4343
<!-- Do not deploy this module to Maven central -->
44-
<plugin>
45-
<groupId>org.sonatype.plugins</groupId>
46-
<artifactId>nexus-staging-maven-plugin</artifactId>
47-
<configuration>
48-
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
49-
</configuration>
50-
</plugin>
5144
<plugin>
5245
<groupId>org.apache.maven.plugins</groupId>
5346
<artifactId>maven-deploy-plugin</artifactId>

pom.xml

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
<maven.install.plugin.version>3.1.1</maven.install.plugin.version>
3838
<maven.jar.plugin.version>3.3.0</maven.jar.plugin.version>
3939
<maven.javadoc.plugin.version>3.11.2</maven.javadoc.plugin.version>
40-
<maven.nexus-staging.plugin.version>1.6.13</maven.nexus-staging.plugin.version>
4140
<maven.plugin.annotations.version>3.13.1</maven.plugin.annotations.version>
4241
<maven.plugin.plugin.version>3.9.0</maven.plugin.plugin.version>
4342
<maven.release.plugin.version>3.0.1</maven.release.plugin.version>
4443
<maven.resource.plugin.version>3.3.1</maven.resource.plugin.version>
4544
<maven.scm.plugin.version>1.11.2</maven.scm.plugin.version>
45+
<maven.sonatype.central.plugin.version>0.7.0</maven.sonatype.central.plugin.version>
4646
<maven.source.plugin.version>3.0.1</maven.source.plugin.version>
4747
<maven.surefire.plugin.version>3.5.3</maven.surefire.plugin.version>
4848
<maven.war.plugin.version>3.4.0</maven.war.plugin.version>
@@ -55,7 +55,6 @@
5555
<log4j2.version>2.23.1</log4j2.version>
5656
<slf4j.version>2.0.17</slf4j.version>
5757
<vertx.version>4.5.11</vertx.version>
58-
<xstream.version>1.4.21</xstream.version>
5958

6059
<!-- Documentation -->
6160
<javadoc.options>-Xdoclint:none</javadoc.options>
@@ -274,25 +273,9 @@
274273
<pluginManagement>
275274
<plugins>
276275
<plugin>
277-
<groupId>org.sonatype.plugins</groupId>
278-
<artifactId>nexus-staging-maven-plugin</artifactId>
279-
<version>${maven.nexus-staging.plugin.version}</version>
280-
<dependencies>
281-
<!--
282-
TODO: Remove after OSSRH-66257, NEXUS-26993 are fixed,
283-
-->
284-
<dependency>
285-
<groupId>com.thoughtworks.xstream</groupId>
286-
<artifactId>xstream</artifactId>
287-
<version>${xstream.version}</version>
288-
</dependency>
289-
</dependencies>
290-
<configuration>
291-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
292-
<serverId>sonatype-nexus-staging</serverId>
293-
<stagingProgressTimeoutMinutes>120</stagingProgressTimeoutMinutes>
294-
<keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
295-
</configuration>
276+
<groupId>org.sonatype.central</groupId>
277+
<artifactId>central-publishing-maven-plugin</artifactId>
278+
<version>${maven.sonatype.central.plugin.version}</version>
296279
</plugin>
297280
<plugin>
298281
<groupId>org.apache.maven.plugins</groupId>
@@ -544,17 +527,15 @@
544527
</plugin>
545528

546529
<plugin>
547-
<groupId>org.sonatype.plugins</groupId>
548-
<artifactId>nexus-staging-maven-plugin</artifactId>
549-
<executions>
550-
<execution>
551-
<id>default-deploy</id>
552-
<phase>deploy</phase>
553-
<goals>
554-
<goal>deploy</goal>
555-
</goals>
556-
</execution>
557-
</executions>
530+
<groupId>org.sonatype.central</groupId>
531+
<artifactId>central-publishing-maven-plugin</artifactId>
532+
<extensions>true</extensions>
533+
<configuration>
534+
<publishingServerId>sonatype-central</publishingServerId>
535+
<excludeArtifacts>
536+
<artifact>citrus-remote-sample</artifact>
537+
</excludeArtifacts>
538+
</configuration>
558539
</plugin>
559540
</plugins>
560541
</build>

scripts/README.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ Options for release:
168168
Works only when on a branch, not when checked out directly.
169169
--log <log-file> Write full log to <log-file>, only print progress to screen
170170
--skip-tests Do not run tests
171-
--keep-staging-repo Do not drop the staging repo (for manual review of what has been uploaded on a dry run)
172171
--no-strict-checksums Do not insist on strict checksum policy for downloaded Maven artifacts
173172
-q --quiet Adds quiet option to Maven options - only show errors
174173
----

scripts/commands/release

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ release::usage() {
4545
Works only when on a branch, not when checked out directly.
4646
--log <log-file> Write full log to <log-file>, only print progress to screen
4747
--skip-tests Do not run tests
48-
--keep-staging-repo Do not drop the staging repo (for manual review of what has been uploaded on a dry run)
4948
--no-strict-checksums Do not insist on strict checksum policy for downloaded Maven artifacts
5049
-q --quiet Adds quiet option to Maven options - only show errors
5150
EOT
@@ -55,7 +54,6 @@ EOT
5554
release::run() {
5655
source "$(basedir)/commands/util/git_funcs"
5756
source "$(basedir)/commands/util/version_funcs"
58-
source "$(basedir)/commands/util/maven_central_funcs"
5957

6058
# Main application directory
6159
local working_dir=$(appdir)
@@ -101,10 +99,6 @@ release::run() {
10199

102100
# For a test run, we are done
103101
if [ $(hasflag --dry-run -n) ]; then
104-
if [ ! $(hasflag --snapshot-release) ] && [ ! $(hasflag --local-release) ] && [ ! $(hasflag --keep-staging-repo) ]; then
105-
drop_staging_repo "$working_dir" "$maven_opts"
106-
fi
107-
108102
echo "==== Dry run finished, nothing has been committed"
109103
echo "==== Use 'git reset --hard' to cleanup"
110104
exit 0
@@ -115,10 +109,6 @@ release::run() {
115109
# --------------------------
116110

117111
if [ ! $(hasflag --local-release) ] && [ ! $(hasflag --snapshot-release) ]; then
118-
# Release staging repo
119-
# NOTE: not working recently (because of timeouts) - fallback to doing this manually
120-
# release_staging_repo "$working_dir" "$maven_opts"
121-
122112
# Push everything (if configured)
123113
git_push "$working_dir" "$release_version"
124114

@@ -165,9 +155,12 @@ build_and_stage_artifacts() {
165155
elif [ $(hasflag --snapshot-release) ]; then
166156
echo "==== Release snapshot to local"
167157
./mvnw ${maven_opts} install -pl '!:citrus-remote-sample'
158+
elif [ $(hasflag --dry-run -n) ]; then
159+
echo "==== Release to Maven Central - dry run"
160+
./mvnw ${maven_opts} install deploy -pl '!:citrus-remote-sample' -Dsurefire.failIfNoSpecifiedTests=false -Dfailsafe.failIfNoSpecifiedTests=false -DfailIfNoTests=false -Dtest -Dit.test -Dgpg.autosign=true -Prelease-central
168161
else
169-
echo "==== Release to Maven central and stage artifacts to Sonatype"
170-
./mvnw ${maven_opts} install deploy -pl '!:citrus-remote-sample' -DfailIfNoTests=false -Dtest -Dit.test -Prelease-central -DstagingDescription="Staging Citrus Remote for v$release_version"
162+
echo "==== Release to Maven central"
163+
./mvnw ${maven_opts} install deploy -pl '!:citrus-remote-sample' -Dsurefire.failIfNoSpecifiedTests=false -Dfailsafe.failIfNoSpecifiedTests=false -DfailIfNoTests=false -Dtest -Dit.test -Dgpg.autosign=true -DautoPublish=true -Prelease-central
171164
fi
172165
}
173166

@@ -198,7 +191,7 @@ extract_maven_opts() {
198191

199192
if [ $(hasflag --skip-tests) ]; then
200193
# Do not run any tests but compile test sources
201-
maven_opts="$maven_opts -Dtest -Dit.test -DfailIfNoTests=false"
194+
maven_opts="$maven_opts -Dtest -Dit.test -Dsurefire.failIfNoSpecifiedTests=false -Dfailsafe.failIfNoSpecifiedTests=false -DfailIfNoTests=false"
202195
fi
203196

204197
if [ ! $(hasflag --no-strict-checksums) ]; then

scripts/commands/util/maven_central_funcs

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)