How to hide svnuser and password credential from console output.
- Go to Jenkins > credentials > system > Global credentials
- Click on Add Credentials on left menu
- Enter against Username field and Password field.(it might appear with some filled values but you can clear it and enter your value) and save.
- Click OK
- No go to your Jenkins job.
- Go to Build Environment >> select “Use secre text(s) or file(s)
- Bindings section will appear and select Username and password (separated)
- Enter your username variable and password variable.
- Select your credentials for these variables from credentials drop down.
- Now go to Build section >>Advance
- And set up as below
- Click Apply and Save
Go to your gradle code and modify retrieve your param like this
println USER_E_NAME
svnuser = USER_E_NAME
svnpassword = USER_E_PASSWORD
println USER_P_PASSWORD
and in console output print will be
****
****
In SvnInfo(svnuser, svnpassword, repoUrlForInfo)
You good to go now