Maven 2 & 3

NPE in addEdgeWithParentCheck

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0.5
  • Component/s: None
  • Labels:
    None
  • Environment:
    Winxp
  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

E:\STC\workarea\svn\build\maven\sample-mojo>mvn install
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ----------------------------------------------------------------------------
[INFO] null
[INFO] ----------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException
at org.apache.maven.project.ProjectSorter.addEdgeWithParentCheck(ProjectSorter.java:172)
at org.apache.maven.project.ProjectSorter.<init>(ProjectSorter.java:123)
at org.apache.maven.execution.ReactorManager.<init>(ReactorManager.java:54)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:286)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Pom looks like this:
<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>

<groupId>com.stchome.maven.mojo</groupId>

<version>1.0</version>
<artifactId>test</artifactId>
<packaging>pom</packaging>
<modules>
<module>extract-war</module>
<module>helloUser</module>
</modules>
</project>

Activity

Hide
John Casey added a comment -

I suspect this has been fixed for a long time now (since I know I've looked at that piece of code before regarding a NPE), but I've added an extra null check on the only value that could possibly be null. Also added a unit test for a project that references another project which is not in the list.

Show
John Casey added a comment - I suspect this has been fixed for a long time now (since I know I've looked at that piece of code before regarding a NPE), but I've added an extra null check on the only value that could possibly be null. Also added a unit test for a project that references another project which is not in the list.

People

Vote (2)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: