[JIRA] (JENKINS-55270) JavaDoc for UpdateCenter.getPlugin() references hudson.util.VersionNumber but returns 404

0 views
Skip to first unread message

Predatorian3@gmail.com (JIRA)

unread,
Dec 19, 2018, 5:53:02 PM12/19/18
to jenkinsc...@googlegroups.com
Phil Dudley created an issue
 
Jenkins / Bug JENKINS-55270
JavaDoc for UpdateCenter.getPlugin() references hudson.util.VersionNumber but returns 404
Issue Type: Bug Bug
Assignee: Max Spring
Components: jenkow-plugin
Created: 2018-12-19 22:52
Priority: Minor Minor
Reporter: Phil Dudley

When looking at the JavaDoc for Jenkins' UpdateCetner

getPlugin() is referencing the hudson.util.VersionNumber. However, it is not listed in the JavDocs, the CLI docs return a 404, and while its listed here:

Its not actually in the Jenkins code base:

I found this when attempting to setup Jenkins using Groovy to go from zero-to-hero and it failed to run on a fresh install, but worked after I had initially setup by hand.

#!groovy
import jenkins.model.Jenkins
import hudson.util.VersionNumber
// Create a reference to the PluginManager Class.
pm = Jenkins.instance.pluginManager
// Create a reference to the UpdateCenter Class.
uc = Jenkins.instance.updateCenter// Disable all the  plugins on the system first.
pm.plugins.each { plugin ->
  plugin.disable()
}
// Used to make sure that the plugins actually installed, and whether or not
// they actually deployed.
deployed = false/**
 * activatePlugins is a recursive function that installs and enables the plugins
 * and their dependencies.
 * However, these don't actually do any version pinning, and picks the latest
 * versions of the plugins.
 *
 * @param plugin [Object]
 *
 * @return nil
 */
def activatePlugin(plugin) {
  if (!plugin.isEnabled()) {
    plugin.enable()
      deployed = true
  }  plugin.getDependencies().each {
    activatePlugin(pm.getPlugin(it.shortName))
  }
}[
  'ant':'1.9',                           // v1.9
  'build-timeout':'1.19',                // v1.19
  'credentials':'2.1.18',                // v2.1.18
  'email-ext':'2.63',                    // v2.63
  'github-branch-source':'2.4.1',        // v2.4.1
  'gradle':'1.29',                       // v1.29
  'jobConfigHistory':'2.19',             // v2.19
  'ldap':'1.20',                         // v1.20
  'matrix-auth':'2.3',                   // v2.3
  'antisamy-markup-formatter': '1.5',    // v1.5
  'pam-auth':'1.4',                      // v1.4
  'workflow-aggregator':'2.6',           // v2.6
  'pipeline-github-lib':'1.0',           // v1.0
  'ssh-slaves':'1.29.1',                 // v1.29.1
  'subversion':'2.12.1',                 // v2.12.1
  'timestamper':'1.8.10',                // v1.8.10
  'ws-cleanup':'0.37'                    // v0.37
].each { plugin, version ->
  if (! pm.getPlugin(plugin)) {
    VersionNumber versionNumber = new VersionNumber(version)
    deployment = uc.getPlugin(plugin, versionNumber).deploy(true)
    deployment.get()
  }
  activatePlugin(pm.getPlugin(plugin))
}// Do a simple verification that the plugins did deploy, then restart Jankins
if (deployed) {
  Jenkins.instance.restart()
}
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

Predatorian3@gmail.com (JIRA)

unread,
Dec 20, 2018, 10:46:02 AM12/20/18
to jenkinsc...@googlegroups.com

Predatorian3@gmail.com (JIRA)

unread,
Dec 20, 2018, 12:04:03 PM12/20/18
to jenkinsc...@googlegroups.com

sk_rw@yahoo.com (JIRA)

unread,
Jun 19, 2019, 5:16:02 PM6/19/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages