NPE in CLIReportingUtils
------------------------
Key: MNG-3918
URL: http://jira.codehaus.org/browse/MNG-3918
Project: Maven 2
Issue Type: Bug
Components: Errors
Affects Versions: 3.0-alpha-1
Reporter: Benjamin Bentmann
Priority: Minor
Attachments: pom.xml
Running "mvn validate" on the attached POM delivers:
{noformat}
java.lang.NullPointerException
at
org.apache.maven.cli.CLIReportingUtils.handleLifecycleExecutionException(CLIReportingUtils.java:270)
at
org.apache.maven.cli.CLIReportingUtils.buildErrorMessage(CLIReportingUtils.java:217)
at
org.apache.maven.cli.CLIReportingUtils.showError(CLIReportingUtils.java:162)
at
org.apache.maven.cli.CLIReportingUtils.showError(CLIReportingUtils.java:138)
at
org.apache.maven.cli.CLIReportingUtils.logResult(CLIReportingUtils.java:80)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:171)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
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:597)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
at org.codehaus.classworlds.Launcher.main(Launcher.java:31)
{noformat}
While the POM is indeed invalid, the original error message doesn't make it to
the user.
The {{LifecycleExecutionException}} to report has no project instance. In this
particular case, the exception is created in {{DefaultLifecycleExecutor}} by
wrapping a {{LifecycleSpecificationException}}. This raises the question
whether the class {{LifecycleException}} should provide a field to carry a
{{MavenProject}} instance, which could then be propagated to the wrapping
exception.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira