Sign artifacts during package phase in release profile

This commit is contained in:
Paul Campbell 2017-12-31 14:17:38 +00:00
parent 43c982f0dc
commit 63caf5bc05
2 changed files with 51 additions and 15 deletions

View file

@ -24,9 +24,17 @@ The POM defines the following items:
* `inceptionYear`
* `licenses`
* `developers`
* `distributionManagement`
The POM sets the following properties:
* `project.reporting.outputEncoding` as `UTF-8`
* `java.version` as `1.8`
### Profile `release`
#### GPG Artifact Signing
Artifacts will be GPG signed during the `package` phase when the `release` profile is enabled.
#### Distribution Management
The Nexus Sonatype repositories are declared within `distributionManagement` when the `release` profile is enableds.

54
pom.xml
View file

@ -5,7 +5,7 @@
<groupId>net.kemitix</groupId>
<artifactId>kemitix-parent</artifactId>
<version>5.0.2</version>
<version>5.0.3</version>
<packaging>pom</packaging>
<name>Kemitix Parent</name>
@ -36,6 +36,7 @@
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
</properties>
<developers>
@ -47,17 +48,44 @@
</developer>
</developers>
<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>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<configuration>
<passphrase>${gpg.passphrase}</passphrase>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>package</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin><!-- maven-gpg-plugin -->
</plugins>
</build>
<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>
</profile>
</profiles><!-- release -->
</project>