[java-parent-project] branch main updated: Add sign-snapshots profile to sign snapshots

Tom Zeller tzeller at dragonacea.biz
Thu Sep 21 12:54:05 UTC 2023


This is an automated email from the git hooks/post-receive script.

tzeller pushed a commit to branch main
in repository java-parent-project.

View the commit online:
http://git.shibboleth.net/view/?p=java-parent-project.git;a=commit;h=4080aece49c19deec6951615447c5f1f2061924b

The following commit(s) were added to refs/heads/main by this push:
     new 4080aec  Add sign-snapshots profile to sign snapshots
4080aec is described below

commit 4080aece49c19deec6951615447c5f1f2061924b
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Thu Sep 21 07:53:43 2023 -0500

    Add sign-snapshots profile to sign snapshots
    
    https://shibboleth.atlassian.net/browse/GEN-333
---
 pom.xml | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/pom.xml b/pom.xml
index 7a64f1e..1e5472e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1013,6 +1013,80 @@
             </build>
         </profile>
 
+
+        <!--
+            The "sign-snapshots" profile is used by Jenkins to sign snapshots.
+        -->
+        <profile>
+            <id>sign-snapshots</id>
+            <build>
+                <plugins>
+                    <!-- Create gnupg-homedir and import secret key from env. -->
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <version>3.1.0</version>
+                        <executions>
+                            <execution>
+                                <id>create-gnupg-homedir-and-import-secret-key-from-env</id>
+                                <phase>verify</phase>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                                <configuration>
+                                    <target>
+                                        <mkdir dir="${project.basedir}/gnupg" />
+                                        <chmod dir="${project.basedir}/gnupg" perm="700" verbose="true" />
+                                        <copy todir="${project.basedir}/gnupg" file="${env.gpg_secret}" verbose="true" />
+                                    </target>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <!-- Sign artifacts with gnupg homedir and passphrase from env. -->
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-gpg-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>sign-artifacts-with-gnupg-homedir-and-passphrase-from-env</id>
+                                <phase>verify</phase>
+                                <goals>
+                                    <goal>sign</goal>
+                                </goals>
+                                <configuration>
+                                    <homedir>${project.basedir}/gnupg</homedir>
+                                    <passphrase>${env.gpg_passphrase}</passphrase>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <!-- Delete gnupg homedir. -->
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-clean-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>delete-gnupg-homedir</id>
+                                <phase>verify</phase>
+                                <goals>
+                                    <goal>clean</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
+                            <filesets>
+                                <fileset>
+                                    <directory>${project.basedir}/gnupg</directory>
+                                </fileset>
+                            </filesets>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
         <!--
             The "lint" profile adds more warnings to compilation. In particular,
             it enables checking for unsafe or unchecked operations.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list