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

maven-plugin not usable as a dependency with parent-pom 2.31+

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • maven-plugin
    • None

      when you have a plugin using jenkins-plugins 2.31+ as it's parent and a dependency on the maven plugin then the build will fail.

      This is because the RequireUpperBounds enforcer will fail as all the different versions of the interceptors and agents use conflicting versions of the core maven libraries.

      [WARNING] Rule 5: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
      Failed while enforcing RequireUpperBoundDeps. The error(s) are [
      Require upper bound dependencies error for org.apache.maven:maven-embedder:3.1.0 paths to dependency are:
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.apache.maven:maven-embedder:3.1.0
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven3-agent:1.6
            +-org.apache.maven:maven-embedder:3.0.5
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven31-agent:1.6
            +-org.apache.maven:maven-embedder:3.1.0
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven32-agent:1.6
            +-org.apache.maven:maven-embedder:3.2.3
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven3-interceptor:1.6
            +-org.apache.maven:maven-embedder:3.0.5
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven31-interceptor:1.6
            +-org.apache.maven:maven-embedder:3.1.0
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven32-interceptor:1.6
            +-org.apache.maven:maven-embedder:3.2.3
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven3-interceptor-commons:1.6
            +-org.apache.maven:maven-embedder:3.0.5
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.lib:lib-jenkins-maven-embedder:3.11
            +-org.apache.maven:maven-embedder:3.1.0
      ,
      Require upper bound dependencies error for org.apache.maven:maven-core:3.1.0 paths to dependency are:
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.apache.maven:maven-core:3.1.0
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven3-interceptor:1.6
            +-org.apache.maven:maven-core:3.0.5
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven31-interceptor:1.6
            +-org.apache.maven:maven-core:3.1.0
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven32-interceptor:1.6
            +-org.apache.maven:maven-core:3.2.3
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven3-interceptor-commons:1.6
            +-org.apache.maven:maven-core:3.0.5
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.apache.maven:maven-compat:3.1.0
            +-org.apache.maven:maven-core:3.1.0
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.apache.maven:maven-embedder:3.1.0
            +-org.apache.maven:maven-core:3.1.0
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.lib:lib-jenkins-maven-embedder:3.11
            +-org.apache.maven:maven-core:3.1.0
      ,
      Require upper bound dependencies error for org.apache.maven:maven-aether-provider:3.1.0 paths to dependency are:
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.apache.maven:maven-aether-provider:3.1.0
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven3-interceptor:1.6
            +-org.apache.maven:maven-aether-provider:3.0.5
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven31-interceptor:1.6
            +-org.apache.maven:maven-aether-provider:3.1.0
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven32-interceptor:1.6
            +-org.apache.maven:maven-aether-provider:3.2.3
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.main.maven:maven3-interceptor-commons:1.6
            +-org.apache.maven:maven-aether-provider:3.0.5
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.apache.maven:maven-core:3.1.0
            +-org.apache.maven:maven-aether-provider:3.1.0
      and
      +-com.acme.wibble:my-project:1.0.0-SNAPSHOT
        +-org.jenkins-ci.main:maven-plugin:2.11
          +-org.jenkins-ci.lib:lib-jenkins-maven-embedder:3.11
            +-org.apache.maven:maven-aether-provider:3.1.0
      ]
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 10.994 s
      [INFO] Finished at: 2017-07-03T17:48:51+01:00
      [INFO] Final Memory: 35M/369M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.2.jenkins-1:enforce (display-info) on project my-project: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
      

      these conflicts are wholly within the maven-plugin project and do not include any 3rd party plugins or other dependencies.

      If you attempt to exclude these transitive dependencies then the build will fail when the maven project type is used within a JenkinsRule

      Parsing POMs
      FATAL: org/apache/maven/project/ProjectBuildingException
      java.lang.ClassNotFoundException: org.apache.maven.project.ProjectBuildingException
      

      jglick suggests that the potential fix may be to make the maven libraries have scope=provided

            oleg_nenashev Oleg Nenashev
            teilo James Nord
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: