Reputation:
I want to install jenkins plugin programmatically using java. can any one help me on this?
Upvotes: 1
Views: 385
Reputation: 6173
You can access Jenkins remotely using the remote api . This can be used to install plugins as well, look at this gist and for example:
curl -X POST -d '<jenkins><install plugin="[email protected]" /></jenkins>' --header 'Content-Type: text/xml' http://localhost:8080/pluginManager/installNecessaryPlugins
will install the git plugin. So by using some HTTP library in Java you can do this from Java as well, posting HTTP requests to the remote api and installing plugins.
Upvotes: 3