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

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

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: maven-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      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
      

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

        Attachments

          Activity

          Hide
          aheritier Arnaud Héritier added a comment -

          Fixed in 3.0(-rc1)

          Show
          aheritier Arnaud Héritier added a comment - Fixed in 3.0(-rc1)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Arnaud Heritier
          Path:
          pom.xml
          src/main/java/hudson/maven/MavenBuild.java
          src/test/java/hudson/maven/AbstractMaven3xBuildTest.java
          src/test/java/hudson/maven/Maven31xBuildTest.java
          src/test/java/hudson/maven/Maven339BuildTest.java
          src/test/java/hudson/maven/Maven35xBuildTest.java
          http://jenkins-ci.org/commit/maven-plugin/6891d0bee159ea9dd614b0a5d36a969820ca79bb
          Log:
          Merge pull request #102 from oleg-nenashev/facelift

          [JENKINS-46053, JENKINS-45271, JENKINS-46210, JENKINS-46148] - Update HttpClient libraries and Fix Parent POM

          Compare: https://github.com/jenkinsci/maven-plugin/compare/5a3d468d42d6...6891d0bee159

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Arnaud Heritier Path: pom.xml src/main/java/hudson/maven/MavenBuild.java src/test/java/hudson/maven/AbstractMaven3xBuildTest.java src/test/java/hudson/maven/Maven31xBuildTest.java src/test/java/hudson/maven/Maven339BuildTest.java src/test/java/hudson/maven/Maven35xBuildTest.java http://jenkins-ci.org/commit/maven-plugin/6891d0bee159ea9dd614b0a5d36a969820ca79bb Log: Merge pull request #102 from oleg-nenashev/facelift [JENKINS-46053, JENKINS-45271, JENKINS-46210, JENKINS-46148] - Update HttpClient libraries and Fix Parent POM Compare: https://github.com/jenkinsci/maven-plugin/compare/5a3d468d42d6...6891d0bee159
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          pom.xml
          http://jenkins-ci.org/commit/maven-plugin/4826ae7bc381d3d10abefdd1e23864020e548422
          Log:
          [JENKINS-46053, JENKINS-45271] Update Parent POM.xml, pick dev versions of Apache HttpClient plugin and Maven Interceptors

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: pom.xml http://jenkins-ci.org/commit/maven-plugin/4826ae7bc381d3d10abefdd1e23864020e548422 Log: [JENKINS-46053, JENKINS-45271] Update Parent POM.xml, pick dev versions of Apache HttpClient plugin and Maven Interceptors
          Hide
          jglick Jesse Glick added a comment -

          The workaround would simply be to exclude enforcement of upper bounds on those artifacts, but yes I suspect the proper fix is to use provided scope. Should be possible to prototype in maven-plugin itself simply by updating its parent POM.

          Show
          jglick Jesse Glick added a comment - The workaround would simply be to exclude enforcement of upper bounds on those artifacts, but yes I suspect the proper fix is to use provided scope. Should be possible to prototype in maven-plugin itself simply by updating its parent POM.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: