How can I find the path to a Jenkins plugin if I want to use it from a groovy script?
For example, just testing on the master, I'd like to be able to use the LabelParameterValue class from the NodeLabelParameter plugin. An example of what I'm looking for is below, (though it doesn't work).
currentParameters.add(new hudson.plugins.nodelabelparameter.LabelParameterValue(nodeName))
In Postbuild Groovy script you can specify Additional groovy classpath. For example: /var/jenkins/plugins/claim/WEB-INF/classes
for Claim plugin code. I tried it and it worked.
Unfortunately the path has to be absolute and does not allow for environment variables (such as ${JENKINS_HOME}
). Also, I am not entirely sure where the script will look when run on a slave - on the slave or on master.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With