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` * `inceptionYear`
* `licenses` * `licenses`
* `developers` * `developers`
* `distributionManagement`
The POM sets the following properties: The POM sets the following properties:
* `project.reporting.outputEncoding` as `UTF-8` * `project.reporting.outputEncoding` as `UTF-8`
* `java.version` as `1.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.

30
pom.xml
View file

@ -5,7 +5,7 @@
<groupId>net.kemitix</groupId> <groupId>net.kemitix</groupId>
<artifactId>kemitix-parent</artifactId> <artifactId>kemitix-parent</artifactId>
<version>5.0.2</version> <version>5.0.3</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Kemitix Parent</name> <name>Kemitix Parent</name>
@ -36,6 +36,7 @@
<properties> <properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
</properties> </properties>
<developers> <developers>
@ -47,6 +48,31 @@
</developer> </developer>
</developers> </developers>
<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> <distributionManagement>
<snapshotRepository> <snapshotRepository>
<id>sonatype-nexus-snapshots</id> <id>sonatype-nexus-snapshots</id>
@ -59,5 +85,7 @@
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository> </repository>
</distributionManagement> </distributionManagement>
</profile>
</profiles><!-- release -->
</project> </project>