Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: 1.17

Allows credentials to be bound to environment variables for use from miscellaneous build steps.

Wiki Markup

You may have a keystore for jarsigner, a list of passwords, or other confidential files or strings which you want to be used by a job but which should not be kept in its SCM, or even visible from its config.xml. Saving these files on the server and referring to them by absolute path requires you to have a server login, and does not work on slaves. This plugin gives you an easy way to package up all a job’s secret files and passwords and access them using a single environment variable during the build.


No Format
withCredentials([usernamePassword(credentialsId: 'amazon', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
  // available as an env variable, but will be masked if you try to print it out any which way
  // note: single quotes prevent Groovy interpolation; expansion is by Bourne Shell, which is what you want
  sh 'echo $PASSWORD'
  // also available as a Groovy variable
  // or inside double quotes for string interpolation
  echo "username is $USERNAME"


Version 1.17 (2018-10-29)

  • Improved stream flush behavior in light of JEP-210.

Version 1.16 (Mar 19, 2018)

  • Jira
    serverJenkins JIRA
  • Improving help text in light of 
    serverJenkins JIRA