NPE in maven-javadoc-plugin
---------------------------

         Key: MNG-809
         URL: http://jira.codehaus.org/browse/MNG-809
     Project: Maven 2
        Type: Bug
  Components: maven-plugins  
    Versions: 2.0-beta-1    
 Environment: Windows 2k3 SP1. JDK 1.5.0_04
 Reporter: md
 Attachments: JavadocReport.java

running m2 javadoc:javadoc fails with an NPE:

[ERROR] BUILD ERROR
[INFO] 
----------------------------------------------------------------------------
[INFO] Diagnosis: An error has occurred in JavaDocs report generation.
[INFO] 
----------------------------------------------------------------------------
[ERROR] Cause:
org.apache.maven.plugin.MojoExecutionException: An error has occurred in 
JavaDocs report generation.
        at 
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:98)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:346)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:478)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:459)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:441)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:316)
        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:585)
        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: An error has 
occurred in javadoc report generation.
        at 
org.apache.maven.plugin.javadoc.JavadocReport.executeReport(JavadocReport.java:857)
        at 
org.apache.maven.plugin.javadoc.JavadocReport.generate(JavadocReport.java:618)
        at 
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:92)
        ... 16 more
Caused by: java.lang.NullPointerException
        at 
org.apache.maven.plugin.javadoc.JavadocReport.executeReport(JavadocReport.java:800)
        ... 18 more

I looked at the source code; looks like the variable doctitle needs to be 
initialized with the static variable DEFAULT_DOCTITLE in it's declaration on 
line 337 in org.apache.maven.plugin.javadoc.JavadocReport. I tested this fix on 
my machine and the NPE went away and the target/javadoc folder appeared.

Attaching the file with the change on line 337.



-- 
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]

Reply via email to