Skip to content

Commit dc12dff

Browse files
committed
Switch to nexus-staging-maven-plugin for releases
1 parent b35549d commit dc12dff

File tree

2 files changed

+62
-9
lines changed

2 files changed

+62
-9
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,30 @@ To execute only one of them, execute `mvn integration-test -Dinvoker.test=test_a
474474
Also, there are many [example projects](https://github.com/scoverage/scoverage-maven-samples/tree/scoverage-maven-samples-1.4.11/) for older versions of the plugin in a separate repo.
475475
Go to one of them and run `mvn site`.
476476

477+
## Development
478+
479+
### Manual deployment
480+
481+
Set sonatype credentials in `~/.m2/settings.xml`:
482+
483+
```xml
484+
<settings>
485+
<servers>
486+
<server>
487+
<id>central</id>
488+
<username>sonatype-username-goes-here</username>
489+
<password>sonatype-password-goes-here</password>
490+
</server>
491+
</servers>
492+
</settings>
493+
```
494+
495+
#### Snapshot deployment
496+
To deploy snapshot to sonatype snapshot repo run `mvn clean deploy -P release`.
497+
498+
#### Release deployment
499+
To deploy release to sonatype release repo run `mvn release:clean release:prepare release:perform -P release`.
500+
477501
## License
478502
```
479503
This software is licensed under the Apache 2 license, quoted below.

pom.xml

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ under the License.
1919

2020
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2121

22-
<parent>
23-
<groupId>org.sonatype.oss</groupId>
24-
<artifactId>oss-parent</artifactId>
25-
<version>7</version>
26-
</parent>
27-
2822
<modelVersion>4.0.0</modelVersion>
2923
<groupId>org.scoverage</groupId>
3024
<artifactId>scoverage-maven-plugin</artifactId>
@@ -53,6 +47,17 @@ under the License.
5347
<url>https://github.com/scoverage/scoverage-maven-plugin/issues</url>
5448
</issueManagement>
5549

50+
<distributionManagement>
51+
<snapshotRepository>
52+
<id>central</id>
53+
<url>${nexus.url}/content/repositories/snapshots</url>
54+
</snapshotRepository>
55+
<repository>
56+
<id>central</id>
57+
<url>${nexus.url}/service/local/staging/deploy/maven2</url>
58+
</repository>
59+
</distributionManagement>
60+
5661
<developers>
5762
<developer>
5863
<id>sksamuel</id>
@@ -94,6 +99,8 @@ under the License.
9499

95100
<scalac-scoverage-plugin.version>2.0.11</scalac-scoverage-plugin.version>
96101
<scalac-scoverage-plugin.scala.version>2.13</scalac-scoverage-plugin.scala.version>
102+
103+
<nexus.url>https://oss.sonatype.org</nexus.url>
97104
</properties>
98105

99106
<dependencies>
@@ -328,6 +335,9 @@ under the License.
328335
<version>3.0.1</version>
329336
<configuration>
330337
<autoVersionSubmodules>true</autoVersionSubmodules>
338+
<useReleaseProfile>false</useReleaseProfile>
339+
<releaseProfiles>release</releaseProfiles>
340+
<goals>deploy</goals>
331341
</configuration>
332342
</plugin>
333343

@@ -740,11 +750,10 @@ under the License.
740750
</plugin>
741751
</plugins>
742752
</build>
743-
</profile>
753+
</profile>
744754

745755
<profile>
746-
<id>sonatype-oss-release</id> <!-- org.sonatype.oss:oss-parent:7 (parent) defined profile - plugin versions upgraded -->
747-
756+
<id>release</id>
748757
<build>
749758
<plugins>
750759
<plugin>
@@ -761,6 +770,26 @@ under the License.
761770
<groupId>org.apache.maven.plugins</groupId>
762771
<artifactId>maven-gpg-plugin</artifactId>
763772
<version>3.1.0</version>
773+
<executions>
774+
<execution>
775+
<phase>verify</phase>
776+
<goals>
777+
<goal>sign</goal>
778+
</goals>
779+
</execution>
780+
</executions>
781+
</plugin>
782+
783+
<plugin>
784+
<groupId>org.sonatype.plugins</groupId>
785+
<artifactId>nexus-staging-maven-plugin</artifactId>
786+
<version>1.6.13</version>
787+
<extensions>true</extensions>
788+
<configuration>
789+
<nexusUrl>${nexus.url}</nexusUrl>
790+
<serverId>central</serverId>
791+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
792+
</configuration>
764793
</plugin>
765794
</plugins>
766795
</build>

0 commit comments

Comments
 (0)