How do I pass JNLP command arguments from a file?

Article ID:360035199311
1 minute readKnowledge base

Issue

We want to be able to launch a JNLP agent using command line options, nevertheless when the agent is running others could get connection information that we would prefer to hide from a ps command execution.

Resolution

As described in one of the comments inside JENKINS-18342, we can create a file where each entry shown below must be in a different line:

params.txt

-jnlpUrl
https://somewhere/xx.jnlp
-secret
<SECRET>

Once that we save this file as params.txt we should be able to invoke the agent using the syntax shown below:

java -jar agent.jar @params.txt