Reputation: 79
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()}")
}
Upvotes: 2
Views: 2119
Reputation: 14574
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'}")
}
Upvotes: 1