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

sblackmon pushed a commit to branch snapshots
in repository https://gitbox.apache.org/repos/asf/streams.git


The following commit(s) were added to refs/heads/snapshots by this push:
     new 7c1967aabd try wagon script approach
7c1967aabd is described below

commit 7c1967aabdc05cab0d95d6ae6adf0ba03b06f791
Author: Steve Blackmon <sblack...@apache.org>
AuthorDate: Fri Feb 16 16:43:40 2024 -0600

    try wagon script approach
    
    Signed-off-by: Steve Blackmon <sblack...@apache.org>
---
 Jenkinsfile | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index e7b72a18d9..87a29b9f73 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,13 +31,14 @@ pipeline {
     environment {
         LANG = 'C.UTF-8'
         MAVEN_CLI_OPTS = "--batch-mode --errors --fail-at-end --show-version 
--no-transfer-progress"
+        MAVEN_DEPLOY_LOCAL_DIR = "/tmp/maven_deploy_dir"
     }
 
     stages {
 
                stage ('Build') {
             steps {
-                           sh "mvnw ${MAVEN_CLI_OPTS} -P 'java-17' 
-Dmaven.test.skip.exec=true clean install"
+                           sh "mvn ${MAVEN_CLI_OPTS} -P 'java-17' 
-Dmaven.test.skip.exec=true clean install"
                        }
                        post {
                 success {
@@ -48,7 +49,7 @@ pipeline {
 
         stage ('Test') {
             steps {
-                           sh "mvnw ${MAVEN_CLI_OPTS} -P 'java-17' verify"
+                           sh "mvn ${MAVEN_CLI_OPTS} -P 'java-17' verify"
                        }
                        post {
                 always {
@@ -62,8 +63,20 @@ pipeline {
                 branch 'snapshots'
             }
             steps {
-                // Use release profile defined in project pom.xml
-                sh "mvnw ${MAVEN_CLI_OPTS} -Dmaven.test.skip.exec=true deploy"
+                script {
+                    withCredentials([usernamePassword(credentialsId: 
env.MAVEN_REPO_CREDS_ID, usernameVariable: 'REPOSITORY_USER', passwordVariable: 
'REPOSITORY_TOKEN')]) {
+                        configFileProvider([configFile(fileId: 
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
+                            getMavenCommand()
+                                .withSettingsXmlFile(MAVEN_SETTINGS_FILE)
+                                .withProperty('wagon.source', 
env.MAVEN_DEPLOY_LOCAL_DIR)
+                                .withProperty('wagon.target', 
env.MAVEN_DEPLOY_REPOSITORY)
+                                .withProperty('wagon.targetId', 
'apache-snapshots')
+                                
.withProperty('apache.snapshot.repository.username', REPOSITORY_USER)
+                                
.withProperty('apache.snapshot.repository.password', REPOSITORY_TOKEN)
+                                
.run("org.codehaus.mojo:wagon-maven-plugin:2.0.2:merge-maven-repos")
+                        }
+                    }
+                }
             }
         }
 

Reply via email to