Jenkins how to list all installed plugins, their version and latest update version

Viewed 74

Part of Jenkins housekeeping, I am looking for a way to list all installed Jenkins plugins with current version and latest version. I have the following code which shows all Jenkins plugins and their version, but it down not show the latest version available.

def pluginList = new ArrayList(Jenkins.instance.pluginManager.plugins)
pluginList.sort { it.getShortName() }.each{
  plugin -> 
    println ("${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()}")
}
1 Answers

Check the following script.

def pluginList = new ArrayList(Jenkins.instance.pluginManager.plugins)

pluginList.sort { it.getShortName() }.each{
  plugin -> 
    println ("${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()} : ${plugin.hasUpdate() ? plugin.getUpdateInfo().version : 'No Update'}")
}
Related