Supply settings.xml to a bash script containing mvn command in jenkins

Viewed 199

I am using Config File Provider Plugin to supply settings.xml file to my maven commands as follows -

steps {
       configFileProvider(
                              [configFile(fileId: 'artifactory-maven', variable: 'MAVEN_SETTINGS')]) {
          sh "mvn -Dvault.useProxy=false -s $MAVEN_SETTINGS -DskipTests=true -e -U -P autoInstallPackage"
          }
       }

Everything works as expected. Now I have another case where I am calling a bash script file that contains a logic with a few mvn commands.

steps {
    sh 'cd testing && ./test-spec-seleniumhub-jenkins'
}

The mvn commands live inside test-spec-seleniumhub-jenkins file. How can I supply the settings.xml file to these mvn commands.

0 Answers
Related