Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60205

Optional dependencies should be considered when resolving version

XMLWordPrintable

      The following yaml file results in a bad dependency version for the git plugin:

       plugins:
        - artifactId: configuration-as-code
          source:
            version: 1.32
        - artifactId: git
          source:
            version: 4.0.0
        - artifactId: workflow-aggregator
          source:
            version: 2.6
        - artifactId: ssh-slaves
          source:
            version: 1.31.0
        - artifactId: build-user-vars
          source:
            version: 1.5
      

      When Jenkins starts, the following happens:

      2019-11-18 15:14:50.418+0000 [id=33]    SEVERE  jenkins.InitReactorRunner$1#onTaskFailed: Failed Loading plugin Jenkins Git plugin v4.0.0 (git)
      java.io.IOException: Jenkins Git plugin version 4.0.0 failed to load.
       - Matrix Project Plugin version 1.4 is older than required. To fix, install version 1.14 or later.
              at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:922)
              at hudson.PluginManager$2$1$1.run(PluginManager.java:545)
              at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
              at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
              at jenkins.model.Jenkins$5.runTask(Jenkins.java:1118)
              at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
              at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      

      It is because the git plugin lists the matrix plugin as optional:

      Plugin-Dependencies: configuration-as-code:1.30;resolution:=optional,w
       orkflow-scm-step:2.9,workflow-step-api:2.20,credentials:2.3.0,git-cli
       ent:3.0.0,mailer:1.23,matrix-project:1.14;resolution:=optional,parame
       terized-trigger:2.33;resolution:=optional,promoted-builds:3.2;resolut
       ion:=optional,scm-api:2.6.3,ssh-credentials:1.17.2,structs:1.20,token
       -macro:2.8;resolution:=optional
      

      But at the same time, the workflow-aggregator depends on the lockable-resources, which depend on matrix-project 1.4. So even though the git plugin lists the matrix-project:1.14 as optional, if it's there, it has to be the "right" version for the git plugin, which means 1.14 instead of 1.4.

      The workaround is to explicitly list matrix-project 1.14 in the yaml.

      Can the plugin manager support this type of situation?

            stopalopa Natasha Stopa
            deepchip Martin d'Anjou
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: