I have passwords defined in the build configuration section titled "Inject passwords to the build as environment variables":
I want to use MYVAR (unencrypted value) in my Active Choices. Unfortunately, it's not working. The reference to MYVAR fails.
In the example below, for testing, I am just trying to display the value of MYVAR as a choice. You can see it fails and the fallback active choices script is used instead.
Ultimately, I want to use this variable to authenticate to a service to build a list of choices but without being able to even reference it in my script. I'm stuck.
When I try "build with parameters":
Thanks for your help in advance!
Inspired by @Bruno's comment I developed the following to be entered in:
Questions:
try-with-resources
not work?Job's
config.xml
Build with Parameters
I leave it as a challenge for the reader to iterate over Nodes when using
XPathExpression.evaluate
(...,
XPathConstants.NODESET
)
in case there is more than one parameter of the same type.I think this is not going to work. Why? Well, the Build Environment options of the EnvInject Plugin read:
and
At the time the Active Choices Plugin comes into play the build hasn't started yet and hence the injection hasn't taken place.