Skip to content

Commit

Permalink
maven profile to sign the build automatically if gpg keys exist
Browse files Browse the repository at this point in the history
  • Loading branch information
mattloveparasoft committed Nov 10, 2023
1 parent 6842e0e commit e00885c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<maven-clean-plugin.version>3.3.1</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
<maven-install-plugin.version>3.1.1</maven-install-plugin.version>
<maven-invoker-plugin.version>3.6.0</maven-invoker-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
Expand Down Expand Up @@ -186,6 +187,10 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>${maven-install-plugin.version}</version>
Expand Down Expand Up @@ -323,5 +328,30 @@
</plugins>
</build>
</profile>
<profile>
<id>sign</id>
<activation>
<file>
<exists>${user.home}/.gnupg</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit e00885c

Please sign in to comment.