I have setup a pipeline script, that will build a JAR using maven and the parameters are coming from Jenkins for the JAR. One of which is a password.
stages {
stage('Maven Build') {
steps {
script {
echo "Maven Build"
withMaven(jdk: javaVersion, maven: mavenVersion) {
sh 'mvn clean install'
}
}
}
}
stage('Branch Creation') {
steps {
script {
sh """
set +x
"java -jar target/github-branch-creator-1.0-SNAPSHOT-jar-with-dependencies.jar ${params.Username} ${params.Password} ${params.value1} ${params.value2} ${params.value3}"
"""
}
}
}
}
I did mention """
triple double quotes to accept the parameters from the jenkins, and did set +x
, but it would still print the command in the console.
+java -jar target/github-branch-creator-1.0-SNAPSHOT-jar-with-dependencies.jar abc sensitive_password v1 v2 v2
I tried #!/bin/bash +x
on top of my groovy
script. I still found it to be printing.
If someone can help?