How can I get a list of installed Jenkins plugins?
I searched the Jenkins Remote Access API document, but it was not found. Should I use Jenkins' CLI? Is there a document or example?
How can I get a list of installed Jenkins plugins?
I searched the Jenkins Remote Access API document, but it was not found. Should I use Jenkins' CLI? Is there a document or example?
I think these are not good enough answer(s)... many involve a couple of extra under-the-hood steps. Here's how I did it.
...because the JSON output needs to be consumed after you call the API.
Another option for Python users:
There are lots of way to fetch this information but I am writing two ways as below : -
1. Get the jenkins cli.
The jenkins CLI will allow us to interact with our jenkins server from the command line. We can get it with a simple curl call.
curl 'localhost:8080/jnlpJars/jenkins-cli.jar' > jenkins-cli.jar
2. Create a groovy script. OR from jenkins script console
We need to create a groovy script to parse the information we receive from the jenkins API. This will output each plugin with its version. Save the following as plugins.groovy.
def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins() plugins.each {println "${it.getShortName()}: ${it.getVersion()}"}
Jenkins 1.588 (2nd of November, 2014) & 1.647 (4th of February, 2016)
Jenkins > Manage Jenkins
System Information
Plugins
I wanted a solution that could run on master without any auth requirements and didn't see it here. I made a quick bash script that will pull out all the versions from the plugins dir.