Skip to content

Commit

Permalink
chore: Add Nexus staging Maven plugin
Browse files Browse the repository at this point in the history
Automatically close and release staging repository with Nexus Maven plugin.
  • Loading branch information
christophd committed Nov 11, 2020
1 parent 56dfc7d commit 8b1f4b1
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ help:
./scripts/citrus -h

release:
./scripts/citrus release --git-remote $(RELEASE_GIT_REMOTE) --release-version $(VERSION)
./scripts/citrus release --git-remote $(RELEASE_GIT_REMOTE) --release-version $(VERSION) --skip-tests

release-snapshot:
./scripts/citrus release --git-remote $(RELEASE_GIT_REMOTE) --snapshot-release
Expand Down
45 changes: 32 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,15 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<configuration>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<serverId>sonatype-nexus-staging</serverId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down Expand Up @@ -1428,25 +1437,35 @@
<!-- Distribution Management -->
<profile>
<id>release-central</id>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>

<!-- Deploy using the sonatype nexus staging maven plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
8 changes: 8 additions & 0 deletions tools/maven/citrus-maven-plugin-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
</dependency>
</dependencies>
</plugin>
<!-- Do not deploy this module to Maven central -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down
8 changes: 8 additions & 0 deletions utils/citrus-test-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@

<build>
<plugins>
<!-- Do not deploy this module to Maven central -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down
8 changes: 8 additions & 0 deletions utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@

<build>
<plugins>
<!-- Do not deploy this module to Maven central -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down

0 comments on commit 8b1f4b1

Please sign in to comment.