To install Jenkins plugins from command line, including dependencies, run the following
curl -X POST -d '<jenkins><install plugin="plugin-name@latest" /></jenkins>' --header 'Content-Type: text/xml' http://localhost:8080/pluginManager/installNecessaryPlugins
where,
- replace plugin-name with plugin to be installed
- http://localhost:8080 is the URL where Jenkins service is available. Replace it with your Jenkins url path
- @latest refers to the latest version of the plugin
Alternatively, one can try the following script too
https://gist.github.com/micw/e80d739c6099078ce0f3
curl -X POST -d '<jenkins><install plugin="plugin-name@latest" /></jenkins>' --header 'Content-Type: text/xml' http://localhost:8080/pluginManager/installNecessaryPlugins
where,
- replace plugin-name with plugin to be installed
- http://localhost:8080 is the URL where Jenkins service is available. Replace it with your Jenkins url path
- @latest refers to the latest version of the plugin
Alternatively, one can try the following script too
https://gist.github.com/micw/e80d739c6099078ce0f3