In addition to mention:
The "Snippet Generator" provides documentation on this:
Password Parameters, or any other type of build parameters selected for masking in Hudson's/Jenkins' main configuration screen (Manage Hudson > Configure System), will be automatically masked.
And also provide code generation. Even with specifying in the job
a name and a password doesn't work:
wrap([$class: 'MaskPasswordsBuildWrapper', varPasswordPairs: [[password: '4567', var: 'BAR']]]) {
echo "BAR=${BAR}"
echo "FOO=${FOO}"
}
Result:
groovy.lang.MissingPropertyException: No such property: BAR for class: WorkflowScript
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)