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 d
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()}"}