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

Maven 3 support in maven-plugin

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hudson maven-plugin doesn't work with Maven 3 on Linux. On Linux Hudson builds its own Java command line and does some additional magic to launch Maven. On Windows it works fine because mvn.bat is used instead.

      The mechanism on Linux fails for two reasons:

      1. classworlds-*.jar was upgraded to plexus-classworlds-2.2.2 with Maven 3, so the classpath is wrong.

      2. plexus-classworlds-2.2.2 is not fully backward compatible. After renaming the jar to classworlds-2.2.2.jar the error is:

      $ /opt/java/x86_64/jdk1.6.0_16/bin/java -Xmx768m -XX:MaxPermSize=256m -cp /home/hudson/plugins/maven-plugin/WEB-INF/lib/maven-agent-1.335.jar:/opt/maven/3.0-alpha-5/boot/classworlds-2.2.2.jar hudson.maven.agent.Main /opt/maven/3.0-alpha-5 /usr/share/tomcat5/webapps/hudson/WEB-INF/lib/remoting-1.335.jar /home/hudson/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.335.jar 32917
      Exception in thread "main" java.lang.NoSuchMethodError: org.codehaus.classworlds.Launcher.getWorld()Lorg/codehaus/classworlds/ClassWorld;
      at hudson.maven.agent.Main.main(Main.java:115)
      at hudson.maven.agent.Main.main(Main.java:62)
      ERROR: Failed to launch Maven. Exit code = 1
      Skipping sonar analysis due to bad build status FAILURE
      Finished: FAILURE

      Reason for the above error is that getWorld() returns a different type in 2.2.2 which isn't assignable to the type returned in 1.x.

      A general question: Why does Hudson use different mechanisms for launching Maven on Windows and Linux?

      Tested with 1.335

        Attachments

          Issue Links

            Activity

            Hide
            olamy Olivier Lamy added a comment -

            @lshatzer have a look at JENKINS-8390 and if last build doesn't put a comment in JENKINS-8390

            Show
            olamy Olivier Lamy added a comment - @lshatzer have a look at JENKINS-8390 and if last build doesn't put a comment in JENKINS-8390
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in hudson
            User: Olivier Lamy
            Path:
            changelog.html
            http://hudson-labs.org/commit/core/18f4a8ebc0516bc1a88b78067a058140a673a152
            Log:
            update changelog with JENKINS-4988

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: Olivier Lamy Path: changelog.html http://hudson-labs.org/commit/core/18f4a8ebc0516bc1a88b78067a058140a673a152 Log: update changelog with JENKINS-4988
            Hide
            nparry Nathan Parry added a comment -

            For the folks having issues with downloading your corporate parent POM - I had the same problem and it turned out to be a regression in Maven (MNG-4963) which is supposed to be fixed in Maven 3.0.3.

            Show
            nparry Nathan Parry added a comment - For the folks having issues with downloading your corporate parent POM - I had the same problem and it turned out to be a regression in Maven ( MNG-4963 ) which is supposed to be fixed in Maven 3.0.3.
            Hide
            nparry Nathan Parry added a comment -

            I guess for greater searchability for others unfortunate enough to have the same problem as me - The exact error message I got was:

            Non-resolvable parent POM: Could not find artifact mycompany:myparent:pom:myversion and 'parent.relativePath' points at wrong local POM

            ...And the suggested workaround for MNG-4963 worked for me. This was using Jenkins 1.399 which looks like it uses Maven 3.0.2 internally.

            Show
            nparry Nathan Parry added a comment - I guess for greater searchability for others unfortunate enough to have the same problem as me - The exact error message I got was: Non-resolvable parent POM: Could not find artifact mycompany:myparent:pom:myversion and 'parent.relativePath' points at wrong local POM ...And the suggested workaround for MNG-4963 worked for me. This was using Jenkins 1.399 which looks like it uses Maven 3.0.2 internally.
            Hide
            olamy Olivier Lamy added a comment -

            as someone requested : fix for 1.392 version

            Show
            olamy Olivier Lamy added a comment - as someone requested : fix for 1.392 version

              People

              Assignee:
              olamy Olivier Lamy
              Reporter:
              zlosch zlosch
              Votes:
              155 Vote for this issue
              Watchers:
              138 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: