0
votes

Currently i am using the below option (refer the below screenshot) to send the username and password to pass these to the java program (i will access the username and password using System.getProperty("user"). But when triggering jenkins job remotely i don't know how to pass these (username and password) as these values gets changed every now and then. So my question is how do i pass these when using the remote url (http://localhost:8080/job/Test/build?token=xyz)

Jenkins screenshot

1
What do you mean by "triggering remotely"? What is the difference between opening a browser page to your localhost and a remote system?GhostCat
By calling the jenkins job using the url and i want to pass the user and pass parameters in the url itself, so that i can access in the java program using the system.getproperty()prav kum
Please ignore this question. I have got it incorrectly.prav kum
I think you want to look into jenkins.io/doc/book/using/using-credentials for example.GhostCat
Thing is: you shouldnt send passwords or ids over the network in urls. Jenkins has a lot of infrastructure in place to do that. Finally: there is no "ignore the question". Instead: delete it please!GhostCat

1 Answers

-1
votes

It looks like you're using Maven, and this issue here is likely the fact that Maven requires the options to be set before the goals. So you'd need to use:

-Duser=username -Dpass=password clean install