• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • maven-plugin
    • None
    • Hudson 1.395 (after Upgrade from 1.392)

      The new maven-plugin can't handle the relativePath definitions for the following pom, project see http://www.faktorzehn.org:8081/job/Hudson%20Plug-ins%20%28Maven%29/

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
      
        <parent>
          <groupId>org.jvnet.hudson.plugins</groupId>
          <artifactId>analysis-pom</artifactId>
          <version>1.16</version>
          <relativePath>../analysis-pom/pom.xml</relativePath>
        </parent>
      
        <artifactId>analysis-suite</artifactId>
        <packaging>pom</packaging>
        <name>Static Analysis Plug-ins</name>
        <version>1.0-SNAPSHOT</version>
      
        <modules>
          <module>../analysis-pom</module>
          <module>../analysis-core</module>
          <module>../analysis-test</module>
          <module>../checkstyle</module>
          <module>../dry</module>
          <module>../findbugs</module>
          <module>../pmd</module>
          <module>../tasks</module>
          <module>../warnings</module>
          <module>../analysis-collector</module>
        </modules>
      
        <repositories>
          <repository>
            <id>m.g.o-public</id>
            <url>http://maven.glassfish.org/content/groups/public/</url>
            <releases>
              <enabled>true</enabled>
            </releases>
            <snapshots>
              <enabled>false</enabled>
            </snapshots>
          </repository>
        </repositories>
      
      </project>
      

      The Hudson m2 project type job fails with:

      Started by user hafner
      Building on master
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/analysis-suite
      At revision 38329
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/analysis-core
      U         src/main/resources/hudson/plugins/analysis/views/TabDetail/details.jelly
      At revision 38329
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/analysis-test
      At revision 38329
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/checkstyle
      At revision 38329
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/dry
      At revision 38329
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/findbugs
      At revision 38329
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/pmd
      At revision 38329
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/tasks
      At revision 38329
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/warnings
      At revision 38329
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/analysis-collector
      At revision 38329
      Updating https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/analysis-pom
      At revision 38329
      no change for https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/analysis-suite since the previous build
      no change for https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/analysis-test since the previous build
      no change for https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/checkstyle since the previous build
      no change for https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/dry since the previous build
      no change for https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/findbugs since the previous build
      no change for https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/pmd since the previous build
      no change for https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/tasks since the previous build
      no change for https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/warnings since the previous build
      no change for https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/analysis-collector since the previous build
      no change for https://svn.java.net/svn/hudson~svn/trunk/hudson/plugins/analysis-pom since the previous build
      Found mavenVersion 2.2.1 from file jar:file:/home/hudson/Hudson/tools/maven_2.2.1/lib/maven-2.2.1-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
      Parsing POMs
      ERROR: Processing failed due to a bug in the code. Please report this to hudson-users@googlegroups.com
      java.lang.NullPointerException
      	at hudson.FilePath.isAbsolute(FilePath.java:224)
      	at hudson.FilePath.<init>(FilePath.java:212)
      	at hudson.FilePath.child(FilePath.java:894)
      	at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:554)
      	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)
      	at hudson.model.Run.run(Run.java:1362)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:145)
      project=hudson.maven.MavenModuleSet@33c2841d[Hudson Plug-ins (Maven)]
      project.getModules()=[hudson.maven.MavenModule@49e6f7cb[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-collector][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-collector][relativePath:null], hudson.maven.MavenModule@5a965654[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-core][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-core][relativePath:null], hudson.maven.MavenModule@43fdd342[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-pom][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-pom][relativePath:null], hudson.maven.MavenModule@4d38b4ed[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-suite][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-suite][relativePath:], hudson.maven.MavenModule@45ee5b36[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-test][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-test][relativePath:null], hudson.maven.MavenModule@23a65a18[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:checkstyle][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:checkstyle][relativePath:null], hudson.maven.MavenModule@7e64eff0[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:dry][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:dry][relativePath:null], hudson.maven.MavenModule@14c4b664[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:findbugs][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:findbugs][relativePath:null], hudson.maven.MavenModule@7ea269e2[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:pmd][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:pmd][relativePath:null], hudson.maven.MavenModule@58d5b561[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:tasks][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:tasks][relativePath:null], hudson.maven.MavenModule@367720d7[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:warnings][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:warnings][relativePath:null], hudson.maven.MavenModule@470d1f30[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins.findbugs:library][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins.findbugs:library][relativePath:null], hudson.maven.MavenModule@2e7aacc1[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins.findbugs:parent][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins.findbugs:parent][relativePath:null]]
      project.getRootModule()=hudson.maven.MavenModule@4d38b4ed[Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-suite][Hudson Plug-ins (Maven)/org.jvnet.hudson.plugins:analysis-suite][relativePath:]
      FATAL: null
      java.lang.NullPointerException
      	at hudson.FilePath.isAbsolute(FilePath.java:224)
      	at hudson.FilePath.<init>(FilePath.java:212)
      	at hudson.FilePath.child(FilePath.java:894)
      	at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:554)
      	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)
      	at hudson.model.Run.run(Run.java:1362)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:145)
      

        1. config.xml
          5 kB
        2. MavenModule.patch
          0.4 kB
        3. MavenModuleSetBuild.patch
          1 kB
        4. Screenshot.png
          Screenshot.png
          20 kB

          [JENKINS-8602] New maven-plugin pom parsing fails with NPE

          Marco Rothe added a comment - - edited

          Also occure with 1.396

          ERROR: Processing failed due to a bug in the code. Please report this to jenkins-users@googlegroups.com
          java.lang.NullPointerException
          at hudson.FilePath.isAbsolute(FilePath.java:224)
          at hudson.FilePath.<init>(FilePath.java:212)
          at hudson.FilePath.child(FilePath.java:894)
          at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:559)
          at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)
          at hudson.model.Run.run(Run.java:1362)
          at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:410)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:145)

          We hacked a quick fix for us to get our maven2 projects running again.
          Seams to be releated to MavenModuleSetBuild.toPomInfo and the normalize call which normalize a path like "../moduleOne" to null

          String relPath = PathTool.getRelativeFilePath( this.moduleRootPath, mp.getBasedir().getPath() );
          //PathTool.getRelativeFilePath( this.workspaceProper, mp.getBasedir().getPath() );
          relPath = FilenameUtils.normalize( relPath );

          Marco Rothe added a comment - - edited Also occure with 1.396 ERROR: Processing failed due to a bug in the code. Please report this to jenkins-users@googlegroups.com java.lang.NullPointerException at hudson.FilePath.isAbsolute(FilePath.java:224) at hudson.FilePath.<init>(FilePath.java:212) at hudson.FilePath.child(FilePath.java:894) at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:559) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420) at hudson.model.Run.run(Run.java:1362) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:410) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:145) We hacked a quick fix for us to get our maven2 projects running again. Seams to be releated to MavenModuleSetBuild.toPomInfo and the normalize call which normalize a path like "../moduleOne" to null String relPath = PathTool.getRelativeFilePath( this.moduleRootPath, mp.getBasedir().getPath() ); //PathTool.getRelativeFilePath( this.workspaceProper, mp.getBasedir().getPath() ); relPath = FilenameUtils.normalize( relPath );

          Could you share your quick fix ?

          Xavier Poinsard added a comment - Could you share your quick fix ?

          Marco Rothe added a comment - - edited

          Attached 2 patch files: "Hack for 1.396 to get M2 multi modules projects with relative path get working again"

          The patch for MavenModuleSetBuild follows the suggestion of rainerweinhold in the comment of JENKINS-7684. As rainerweinhold said: "This fixes the execption ... but i don't know the side effects."

          The patch for MavenModule "fix" the Getter of relativePath in the way to not return null to callers (which cause the problem JENKINS-8525)

          Later I checked, that the MavenModuleSetBuild.PomParser.toPomInfo is the source of the null path and a fix should better applied there.
          The code "relPath = FilenameUtils.normalize( relPath )" normalize a path like "../moduleA" to null.
          Just as in JENKINS-7684 already commented the FilenameUtils.normalize seams to be the source of the bug.

          Marco Rothe added a comment - - edited Attached 2 patch files: "Hack for 1.396 to get M2 multi modules projects with relative path get working again" The patch for MavenModuleSetBuild follows the suggestion of rainerweinhold in the comment of JENKINS-7684 . As rainerweinhold said: "This fixes the execption ... but i don't know the side effects." The patch for MavenModule "fix" the Getter of relativePath in the way to not return null to callers (which cause the problem JENKINS-8525 ) Later I checked, that the MavenModuleSetBuild.PomParser.toPomInfo is the source of the null path and a fix should better applied there. The code "relPath = FilenameUtils.normalize( relPath )" normalize a path like "../moduleA" to null. Just as in JENKINS-7684 already commented the FilenameUtils.normalize seams to be the source of the bug.

          Olivier Lamy added a comment -

          fixed with JENKINS-8525
          can you check with master ?

          Olivier Lamy added a comment - fixed with JENKINS-8525 can you check with master ?

          Marco Rothe added a comment -

          Works for me now (build starts with sucess with 1.400-SNAPSHOT), but some of the related bugs are still open - for example JENKINS-8810

          Marco Rothe added a comment - Works for me now (build starts with sucess with 1.400-SNAPSHOT), but some of the related bugs are still open - for example JENKINS-8810

          Marco Rothe added a comment -

          The patch (see JENKINS-7684) was applied to the master 1.400-SNAPSHOT => so with the release of 1.400 it will become "public"

          Marco Rothe added a comment - The patch (see JENKINS-7684 ) was applied to the master 1.400-SNAPSHOT => so with the release of 1.400 it will become "public"

          Liya Katz added a comment -

          Got exactly the same error with Jenkins 1.400

          Liya Katz added a comment - Got exactly the same error with Jenkins 1.400

          Olivier Lamy added a comment -

          see JENKINS-8436
          Probably new fix will help.
          Can you have a look and test the provided war ?

          Olivier Lamy added a comment - see JENKINS-8436 Probably new fix will help. Can you have a look and test the provided war ?

          Liya Katz added a comment -

          Seems like this test war does the job, thanks!
          When will it be officially released?

          Liya Katz added a comment - Seems like this test war does the job, thanks! When will it be officially released?

          Marco Rothe added a comment -

          Because it's integrated into 1.402-SNAPSHOT it will released with 1.402 Jenkins

          Marco Rothe added a comment - Because it's integrated into 1.402-SNAPSHOT it will released with 1.402 Jenkins

            olamy Olivier Lamy
            drulli Ulli Hafner
            Votes:
            16 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: