Error handling needs improvement
--------------------------------
Key: MNG-1096
URL: http://jira.codehaus.org/browse/MNG-1096
Project: Maven 2
Type: Improvement
Components: maven-site-plugin
Versions: 2.0-beta-2
Reporter: David Jackman
I'm actually not sure if this is specific for the site plugin or something more
general for Maven 2 error reporting.
Here was the situation that brought this about: I was trying to build the site
for the maven-site project. At the time, there were two files checked into
src/site/resources/images that had the same name (h3.gif and h3.jpg). (Note:
this problem has since been cleared up.) When executing the site:site goal, I
got the following back:
...
[INFO]
----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
----------------------------------------------------------------------------
[INFO] Diagnosis: Error during report generation
[INFO]
----------------------------------------------------------------------------
After adding the -X option, I get this exception information:
[DEBUG] Trace:
org.apache.maven.plugin.MojoExecutionException: Error during report generation
at org.apache.maven.doxia.DoxiaMojo.execute(DoxiaMojo.java:422)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:417)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:554)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:517)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:498)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:307)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:217)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:247)
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)
Caused by: org.apache.maven.reporting.MavenReportException: Some files are
duplicates in the site directory or in the generated-site directory.
Review the following files for the "English" version:
images\h3
resources\images\h3.gif
resources\images\h3.jpg
at org.apache.maven.doxia.DoxiaMojo.execute(DoxiaMojo.java:312)
... 16 more
It seems like something is throwing an exception with a helpful message, but
it's caught by DoxiaMojo, which then throws a MojoExecutionException that
chains the original exception. Maven is just reporting the
MojoExecutionException message, which doesn't contain the helpful information.
So, to fix this problem, either the DoxiaMojo code should be fixed so the
message in the MojoExecutionException includes the message from the exception
it caught, or the core Maven error reporting code should be fixed so it
includes messages from exceptions chained with the MojoExecutionException.
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]