| I am having an issue installing plugins via groovy script. It seems that the version argument is being completely ignored. This is a bit of sample code which should install version 2.0.0 of the prometheus plugin. The code runs but it just defaults to the most recent version.
import hudson.util.VersionNumber import jenkins.model.* def instance = Jenkins.getInstance() def pm = instance.getPluginManager() def uc = instance.getUpdateCenter() uc.updateAllSites() plugin = uc.getPlugin("prometheus", new VersionNumber("2.0.0")) def installer = plugin.deploy()
I have replicated this issue with other versions of plugins and none of them will install a previous version. It just always defaults to the most recent version. This is happening on Jenkins 2.204.1 running on linux using the the rpm install. |