You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2023/01/03 19:48:05 UTC

[logging-log4j-tools] branch master updated: INFRA-23996 Try to make `maven-gpg-plugin` work, take 4

This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git


The following commit(s) were added to refs/heads/master by this push:
     new b27035f  INFRA-23996 Try to make `maven-gpg-plugin` work, take 4
b27035f is described below

commit b27035ff6d10985bc18f29eec015c5910bd37961
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Tue Jan 3 20:48:58 2023 +0100

    INFRA-23996 Try to make `maven-gpg-plugin` work, take 4
---
 .github/workflows/build.yml |  3 ++-
 log4j-tools-parent/pom.xml  | 14 -----------
 pom.xml                     | 57 +++++++++++++++++++++++++++++++++------------
 3 files changed, 44 insertions(+), 30 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b041ff7..1e0737e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -167,6 +167,8 @@ jobs:
         # For details see: https://maven.apache.org/plugins/maven-gpg-plugin/examples/deploy-signed-artifacts.html
         # `package` must precede `gpg:sign`.
         run: |
+          gpg --list-secret-keys
+          echo $RANDOM | gpg -a -s
           cat ~/.m2/settings.xml
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
@@ -177,7 +179,6 @@ jobs:
         env:
           NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
           NEXUS_PASSWORD: ${{ secrets.NEXUS_PW }}
-          GPG_PASSPHRASE: "random"
 
       - name: Create artifacts (RELEASE)
         if: startsWith(github.ref, 'refs/heads/release/')
diff --git a/log4j-tools-parent/pom.xml b/log4j-tools-parent/pom.xml
index 576c03c..8e721df 100644
--- a/log4j-tools-parent/pom.xml
+++ b/log4j-tools-parent/pom.xml
@@ -124,20 +124,6 @@
         </configuration>
       </plugin>
 
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-source-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>attach-sources</id>
-            <phase>verify</phase>
-            <goals>
-              <goal>jar-no-fork</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
       <!-- Resolves `revision` property prior to deployment.
            Skipping this step would result in artifacts not consumable by Maven.
            https://maven.apache.org/maven-ci-friendly.html#install-deploy -->
diff --git a/pom.xml b/pom.xml
index 8f706a0..a297bec 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,6 @@
 
     <pluginManagement>
       <plugins>
-
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>flatten-maven-plugin</artifactId>
@@ -98,20 +97,6 @@
             <outputDirectory>${project.build.directory}</outputDirectory>
           </configuration>
         </plugin>
-
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-gpg-plugin</artifactId>
-          <version>${maven-gpg-plugin.version}</version>
-          <configuration>
-            <!-- Prevent GPG from using `pinentry` programs -->
-            <gpgArguments>
-              <arg>--pinentry-mode</arg>
-              <arg>loopback</arg>
-            </gpgArguments>
-          </configuration>
-        </plugin>
-
       </plugins>
     </pluginManagement>
 
@@ -154,6 +139,48 @@
 
   </build>
 
+  <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>
+              <useAgent>false</useAgent>
+            </configuration>
+            <executions>
+              <execution>
+                <id>sign-artifacts</id>
+                <phase>verify</phase>
+                <goals>
+                  <goal>sign</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-source-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>attach-sources</id>
+                <goals>
+                  <goal>jar-no-fork</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
   <distributionManagement>
     <!-- `repository` from parent `org.apache.logging:logging-parent` (id: `apache.releases.https`) -->
     <!-- `snapshotRepository` from parent `org.apache.logging:logging-parent` (id: `apache.snapshots.https`) -->