You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by kw...@apache.org on 2021/12/28 10:39:49 UTC

[jackrabbit-filevault-jenkins-lib] branch bugfix/npe-during-deploy-staged updated: use wagon-maven-plugin for deferred deployment

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

kwin pushed a commit to branch bugfix/npe-during-deploy-staged
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault-jenkins-lib.git


The following commit(s) were added to refs/heads/bugfix/npe-during-deploy-staged by this push:
     new 8ffe143  use wagon-maven-plugin for deferred deployment
8ffe143 is described below

commit 8ffe1431c6a611fde440b38809713b1c9b40d30e
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Tue Dec 28 11:38:59 2021 +0100

    use wagon-maven-plugin for deferred deployment
---
 vars/fileVaultMavenStdBuild.groovy | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/vars/fileVaultMavenStdBuild.groovy b/vars/fileVaultMavenStdBuild.groovy
index 7a9badf..7cd334a 100644
--- a/vars/fileVaultMavenStdBuild.groovy
+++ b/vars/fileVaultMavenStdBuild.groovy
@@ -40,7 +40,7 @@ def buildStage(final int jdkVersion, final String nodeLabel, final boolean isMai
         // https://cwiki.apache.org/confluence/display/INFRA/JDK+Installation+Matrix
         def availableJDKs = [ 8: 'jdk_1.8_latest', 9: 'jdk_1.9_latest', 10: 'jdk_10_latest', 11: 'jdk_11_latest', 12: 'jdk_12_latest', 13: 'jdk_13_latest', 14: 'jdk_14_latest', 15: 'jdk_15_latest', 16: 'jdk_16_latest', 17: 'jdk_17_latest', 18: 'jdk_18_latest']
         final String jdkLabel = availableJDKs[jdkVersion]
-        final String stagingPluginGav = "org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8"
+        final String wagonPluginGav = "org.codehaus.mojo:wagon-maven-plugin:2.0.2"
         final String sonarPluginGav = "org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155"
         node(label: nodeLabel) {
             stage("${isMainBuild ? 'Main ' : ''}Maven Build (JDK ${jdkVersion}, ${nodeLabel})") {
@@ -50,16 +50,14 @@ def buildStage(final int jdkVersion, final String nodeLabel, final boolean isMai
                     try {
                         String mavenArguments
                         if (isMainBuild) {
-                            // clean must be executed separately as otherwise local staging directory (below target/nexus-staging) is overwritten (https://issues.sonatype.org/browse/NEXUS-29206)
-                            executeMaven(jdkLabel, 'clean', 'EXPLICIT')
-                            mavenArguments = "-U install site ${stagingPluginGav}:deploy -DskipRemoteStaging=true -Pjacoco-report -Dlogback.configurationFile=vault-core/src/test/resources/logback-only-errors.xml"
+                            mavenArguments = "-U clean site deploy -DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir -Pjacoco-report -Dlogback.configurationFile=vault-core/src/test/resources/logback-only-errors.xml"
                         } else {
                             mavenArguments = '-U clean verify site'
                         }
                         executeMaven(jdkLabel, mavenArguments, 'IMPLICIT')
                         if (isMainBuild && isOnMainBranch()) {
                             // Stash the build results so we can deploy them on another node
-                            stash name: 'filevault-build-snapshots', includes: '**/nexus-staging/**'
+                            stash name: 'local-snapshots-dir', includes: 'local-snapshots-dir/**'
                         }
                     } finally {
                         junit '**/target/surefire-reports/**/*.xml,**/target/failsafe-reports*/**/*.xml'
@@ -84,9 +82,9 @@ def buildStage(final int jdkVersion, final String nodeLabel, final boolean isMai
                         // nexus deployment needs pom.xml
                         checkout scm
                         // Unstash the previously stashed build results.
-                        unstash name: 'filevault-build-snapshots'
+                        unstash name: 'local-snapshots-dir'
                         // https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin#deploy-staged
-                        String mavenArguments = "-X ${stagingPluginGav}:deploy-staged -DskipStaging=true"
+                        String mavenArguments = "-X ${wagonPluginGav}:upload -Dwagon.url=https://repository.apache.org/content/repositories/snapshots -Dwagon.serverId=apache.snapshots.https -Dwagon.fromDir=./local-snapshots-dir -Dwagon.includes=**
                         executeMaven(jdkLabel, mavenArguments, 'EXPLICIT')
                     }
                 }