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

vy pushed a commit to branch asf-nexus2-test
in repository https://gitbox.apache.org/repos/asf/logging-parent.git

commit 9bd1d8089b460d1a0ac05d2096540c65f3aeacbd
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Thu Sep 19 15:49:50 2024 +0200

    Extract Nexus URL using `nexus-staging-maven-plugin`
---
 .github/generate-email.sh                          | 18 ++-------
 .github/workflows/deploy-release-reusable.yaml     |  5 ++-
 pom.xml                                            | 43 ++++++++++++++++++----
 .../ROOT/pages/release-instructions-project.adoc   |  6 ---
 4 files changed, 44 insertions(+), 28 deletions(-)

diff --git a/.github/generate-email.sh b/.github/generate-email.sh
index db563cd..3cb54cd 100755
--- a/.github/generate-email.sh
+++ b/.github/generate-email.sh
@@ -28,12 +28,12 @@ stderr() {
 
 fail_for_invalid_args() {
     stderr "Invalid arguments!"
-    stderr "Expected arguments: <vote|announce> <version> <commitId>"
+    stderr "Expected arguments: <vote|announce> <version> <commitId> 
<nexusUrl>"
     exit 1
 }
 
 # Check arguments
-[ $# -ne 3 ] && fail_for_invalid_args
+[ $# -ne 4 ] && fail_for_invalid_args
 
 # Constants
 PROJECT_NAME="Apache Logging Parent"
@@ -43,6 +43,7 @@ 
PROJECT_STAGING_SITE="${PROJECT_SITE/apache.org/staged.apache.org}"
 PROJECT_REPO="https://github.com/apache/$PROJECT_ID";
 PROJECT_VERSION="$2"
 COMMIT_ID="$3"
+NEXUS_URL="$4"
 
PROJECT_DIST_URL="https://dist.apache.org/repos/dist/dev/logging/$PROJECT_ID/$PROJECT_VERSION";
 
 # Check release notes file
@@ -52,17 +53,6 @@ 
RELEASE_NOTES_FILE="$SCRIPT_DIR/../target/generated-site/antora/modules/ROOT/pag
     exit 1
 }
 
-dump_review_kit() {
-    cat "$SCRIPT_DIR/release-review-kit.txt" \
-        | sed -n '/-----8<-----~( cut here )~-----8<-----/,$p' \
-        | tail -n +2 \
-        | sed -e "s|^|    |g
-                  s|@PROJECT_ID@|$PROJECT_ID|g
-                  s|@PROJECT_VERSION@|$PROJECT_VERSION|g
-                  s|@PROJECT_DIST_URL@|$PROJECT_DIST_URL|g
-                  s|@COMMIT_ID@|${COMMIT_ID:0:8}|g"
-}
-
 dump_release_notes() {
     awk "f{print} /^Release date::/{f=1}" "$RELEASE_NOTES_FILE" \
         | sed -r -e 's|'$PROJECT_REPO'/(issues|pull)/[0-9]+\[([0-9]+)\]|#\2|g
@@ -82,7 +72,7 @@ Website: $PROJECT_STAGING_SITE-$PROJECT_VERSION
 GitHub: $PROJECT_REPO
 Commit: $COMMIT_ID
 Distribution: $PROJECT_DIST_URL
-Nexus: 
https://repository.apache.org/content/repositories/orgapachelogging-<FIXME>
+Nexus: $NEXUS_URL
 Signing key: 0x077e8893a6dcc33dd4a4d5b256e73ba9a0b592d0
 Review kit: https://s.apache.org/logging-parent-release-review-kit
 
diff --git a/.github/workflows/deploy-release-reusable.yaml 
b/.github/workflows/deploy-release-reusable.yaml
index de8eee3..22a778c 100644
--- a/.github/workflows/deploy-release-reusable.yaml
+++ b/.github/workflows/deploy-release-reusable.yaml
@@ -143,6 +143,8 @@ jobs:
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -P deploy,release
+          export NEXUS_URL=$(awk '/^(stagingRepository.url)/ { 
gsub(/(^.+=|\\)/, ""); print $1 }' target/nexus-staging/staging/*.properties)
+          echo "NEXUS_URL=$NEXUS_URL" >> $GITHUB_ENV
 
       # Node.js cache is needed for Antora
       - name: Set up Node.js cache
@@ -273,7 +275,8 @@ jobs:
 
           # Generate emails
           for EMAIL_TYPE in vote announce; do
-            "$GITHUB_WORKSPACE/.github/generate-email.sh" $EMAIL_TYPE 
$PROJECT_VERSION $COMMIT_ID \
+            "$GITHUB_WORKSPACE/.github/generate-email.sh" \
+              "$EMAIL_TYPE" "$PROJECT_VERSION" "$COMMIT_ID" "$NEXUS_URL" \
               > "${DIST_FILENAME_VERSIONED_PREFIX}-email-${EMAIL_TYPE}.txt"
           done
 
diff --git a/pom.xml b/pom.xml
index 5eec467..28592ca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -231,7 +231,6 @@
     
<log4j-changelog-maven-plugin.version>0.9.0</log4j-changelog-maven-plugin.version>
     <maven-artifact-plugin.version>3.5.1</maven-artifact-plugin.version>
     
<restrict-imports-enforcer-rule.version>2.5.0</restrict-imports-enforcer-rule.version>
-    <sign-maven-plugin.version>1.1.0</sign-maven-plugin.version>
     <spotbugs-maven-plugin.version>4.8.6.3</spotbugs-maven-plugin.version>
     <spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
     <xml-maven-plugin.version>1.1.0</xml-maven-plugin.version>
@@ -399,12 +398,6 @@
           <version>${maven-artifact-plugin.version}</version>
         </plugin>
 
-        <plugin>
-          <groupId>org.simplify4u.plugins</groupId>
-          <artifactId>sign-maven-plugin</artifactId>
-          <version>${sign-maven-plugin.version}</version>
-        </plugin>
-
         <plugin>
           <groupId>com.github.spotbugs</groupId>
           <artifactId>spotbugs-maven-plugin</artifactId>
@@ -1321,11 +1314,18 @@
       <id>deploy</id>
 
       <properties>
+
+        <!-- Global configuration -->
         <deployAtEnd>true</deployAtEnd>
         <installAtEnd>true</installAtEnd>
         <skipTests>true</skipTests>
         <spotbugs.skip>true</spotbugs.skip>
         <spotless.check.skip>true</spotless.check.skip>
+
+        <!-- Plugin versions -->
+        
<nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
+        <sign-maven-plugin.version>1.1.0</sign-maven-plugin.version>
+
       </properties>
 
       <build>
@@ -1337,6 +1337,7 @@
           <plugin>
             <groupId>org.simplify4u.plugins</groupId>
             <artifactId>sign-maven-plugin</artifactId>
+            <version>${sign-maven-plugin.version}</version>
             <executions>
               <execution>
                 <goals>
@@ -1346,6 +1347,34 @@
             </executions>
           </plugin>
 
+          <!-- Skip `maven-deploy-plugin`, we will use 
`org.sonatype.plugins:nexus-staging-maven-plugin` instead -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-deploy-plugin</artifactId>
+            <configuration>
+              <skip>true</skip>
+            </configuration>
+          </plugin>
+
+          <!-- Using Sonatype plugin, since it reports the resultant Nexus URL 
-->
+          <plugin>
+            <groupId>org.sonatype.plugins</groupId>
+            <artifactId>nexus-staging-maven-plugin</artifactId>
+            <version>${nexus-staging-maven-plugin.version}</version>
+            <executions>
+              <execution>
+                <id>default-deploy</id>
+                <goals>
+                  <goal>deploy</goal>
+                </goals>
+                <configuration>
+                  <nexusUrl>https://repository.apache.org</nexusUrl>
+                  <serverId>${distMgmtReleasesId}</serverId>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
         </plugins>
 
       </build>
diff --git 
a/src/site/antora/modules/ROOT/pages/release-instructions-project.adoc 
b/src/site/antora/modules/ROOT/pages/release-instructions-project.adoc
index 774e6e7..22fb020 100644
--- a/src/site/antora/modules/ROOT/pages/release-instructions-project.adoc
+++ b/src/site/antora/modules/ROOT/pages/release-instructions-project.adoc
@@ -102,12 +102,6 @@ If not, commit necessary fixes, push, and repeat.
 +
 [WARNING]
 ====
-**Fix the cited https://repository.apache.org[repository.apache.org] URL** in 
the generated email!
-It changes after every Nexus deployment.
-====
-+
-[WARNING]
-====
 Make sure your email is sent in plain text, that is, 
https://infra.apache.org/contrib-email-tips#nohtml[no HTML]!
 If you are using GMail, enable the _"Plain text mode"_ while composing your 
message.
 ====

Reply via email to