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

Jenkins Maven support doesn't handle version ranges in parent definitions

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • maven-plugin
    • None

      Apache Maven 3.2.2 has been updated to support version ranges in the <parent/> element of a POM, but Jenkins does not yet support that, and blows up failing parse the POMs:

      Resetting working tree
      > git reset --hard
      > git clean -fdx
      Parsing POMs
      Failed to transfer Could not transfer artifact com.smxemail:com.smxemail.parent:pom:[2.1.0,3.0.0) from/to Nexus (http://build.smx.co.nz:8081/nexus/content/groups/public-and-snapshots): Illegal character in path at index 103: http://build.smx.co.nz:8081/nexus/content/groups/public-and-snapshots/com/smxemail/com.smxemail.parent/[2.1.0,3.0.0)/com.smxemail.parent-[2.1.0,3.0.0).pom
      ERROR: Failed to parse POMs
      org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
      [FATAL] Non-resolvable parent POM: Could not transfer artifact com.smxemail:com.smxemail.parent:pom:[2.1.0,3.0.0) from/to Nexus (http://build.smx.co.nz:8081/nexus/content/groups/public-and-snapshots): Illegal character in path at index 103: http://build.smx.co.nz:8081/nexus/content/groups/public-and-snapshots/com/smxemail/com.smxemail.parent/[2.1.0,3.0.0)/com.smxemail.parent-[2.1.0,3.0.0).pom and 'parent.relativePath' points at wrong local POM @ line 4, column 13

      at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:364)
      at hudson.maven.MavenEmbedder.buildProjects(MavenEmbedder.java:361)
      at hudson.maven.MavenEmbedder.readProjects(MavenEmbedder.java:331)
      at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1294)

          [JENKINS-23846] Jenkins Maven support doesn't handle version ranges in parent definitions

          Christophe Lallement added a comment - - edited

          Can you upgrade to 3.2.5 ?
          Or add an option to fully skip pom validation

          Thx Christophe

          Christophe Lallement added a comment - - edited Can you upgrade to 3.2.5 ? Or add an option to fully skip pom validation Thx Christophe

          Hi

          I try to fork this plugins and update mvn dependencies but unfortunately it' s not a trivial task
          There is is lot of dependencies on "legacy" jenkins maven libs that are almost deprecated.

          C.

          Christophe Lallement added a comment - Hi I try to fork this plugins and update mvn dependencies but unfortunately it' s not a trivial task There is is lot of dependencies on "legacy" jenkins maven libs that are almost deprecated. C.

          Justin Wesley added a comment -

          I am trying to build and I get

          maven-plugin\target\generated-sources\localizer\hudson\maven\Messages.java:[17,27] error: unmappable character for encoding UTF-8

          from the generated classes.

          Justin Wesley added a comment - I am trying to build and I get maven-plugin\target\generated-sources\localizer\hudson\maven\Messages.java: [17,27] error: unmappable character for encoding UTF-8 from the generated classes.

          Alex Ng added a comment -

          When will this problem being fixed?
          And any workaround?

          Alex Ng added a comment - When will this problem being fixed? And any workaround?

          Mark Lehky added a comment -

          I can replicate this using latest Jenkins. See JENKINS-38808 for additional info.

          Mark Lehky added a comment - I can replicate this using latest Jenkins. See JENKINS-38808 for additional info.

          Luis Ashurei added a comment -

          Reproduced a similar issue with ${project.version} as well.
          Jenkins: 1.584
          Maven Integration plugin: version 2.13; installed 2.9
          Maven: 3.3.3

          Issue detail:
          https://stackoverflow.com/questions/39590893/jenkins-fails-to-parse-pom-with-variables

          Luis Ashurei added a comment - Reproduced a similar issue with ${project.version} as well. Jenkins: 1.584 Maven Integration plugin: version 2.13; installed 2.9 Maven: 3.3.3 Issue detail: https://stackoverflow.com/questions/39590893/jenkins-fails-to-parse-pom-with-variables

          Mukarram Baig added a comment -

          Hey guys - since ranges in parent elements (https://issues.apache.org/jira/browse/MNG-2199) is now available in maven 3.5.0, are there plans to fix it on the jenkins side? 

          Mukarram Baig added a comment - Hey guys - since ranges in parent elements ( https://issues.apache.org/jira/browse/MNG-2199 ) is now available in maven 3.5.0, are there plans to fix it on the jenkins side? 

          Jakub Bochenski added a comment - kilokahn it's unlikely, especially since Cloudbees is now officially telling people to use the pipeline-maven-plugin instead

          Eduardo Souza added a comment -

          This issue will be fixed in maven-plugin when project update lib-jenkins-maven-embedder to version 3.12.2-SNAPSHOT. This version has Maven 3.5.0 embedded with support to range version on parent elements. (https://github.com/jenkinsci/lib-jenkins-maven-embedder/pull/12)

          Test versions:

          • Jenkins: 2.98
          • Maven plugin: 3.1-SNAPSHOT (lib-jenkins-maven-embedder: 3.12.2-SNAPSHOT)
          • Maven: 3.5.0

          Eduardo Souza added a comment - This issue will be fixed in maven-plugin when project update lib-jenkins-maven-embedder to version 3.12.2-SNAPSHOT. This version has Maven 3.5.0 embedded with support to range version on parent elements. ( https://github.com/jenkinsci/lib-jenkins-maven-embedder/pull/12 ) Test versions: Jenkins: 2.98 Maven plugin: 3.1-SNAPSHOT (lib-jenkins-maven-embedder: 3.12.2-SNAPSHOT) Maven: 3.5.0

          André Schulz added a comment -

          Why Jenkins 2.161 (latest) contains maven-plugin-2.14 containing lib-jenkins-maven-embedder-3.11? (jenkins.war\WEB-INF\detached-plugins\maven-plugin.hpi\WEB-INF\lib)

          I replaced lib-jenkins-maven-embedder-3.11 by lib-jenkins-maven-embedder-3.13 (renamed maven-plugin.hpi to maven-plugin_mod.hpi) but getting same error.

          We have 500+ Maven jobs in our Jenkins and don't want to change a lot...

          André Schulz added a comment - Why Jenkins 2.161 (latest) contains maven-plugin-2.14 containing lib-jenkins-maven-embedder-3.11? (jenkins.war\WEB-INF\detached-plugins\maven-plugin.hpi\WEB-INF\lib) I replaced lib-jenkins-maven-embedder-3.11 by lib-jenkins-maven-embedder-3.13 (renamed maven-plugin.hpi to maven-plugin_mod.hpi) but getting same error. We have 500+ Maven jobs in our Jenkins and don't want to change a lot...

            Unassigned Unassigned
            talios talios
            Votes:
            15 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated: