Maven 2.x Javadoc Plugin

Aggregating javadocs doesn't work

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.1
  • Component/s: None
  • Labels:
    None
  • Environment:
    WinXP SP2
    cygwin 1.5.19
    maven 2.0.4
    jdk 1.5.0_06
    javadoc-plugin 2.0 final
    latest released plugins
  • Number of attachments :
    1

Description

When I define <aggregate>true</aggregate> to javadoc plugin configuration in parent pom, javadoc generation doesn't work from the parent (all other configuration options are default). If run under individual components, javadoc is generated without problems. It seems that the child dependencies aren't resolved:

Embedded error: Exit code: 1 - c:/code/apps/project/common/src/main/java/com/company/AbstractLogEnabled.java:3: package org.apache.log4j does not exist
import org.apache.log4j.Logger;

c:/code/apps/component/common-test/src/main/java/com/company/unittest/AbstractDatasourceEnabledTestCase.java:11: package org.apache.commons.dbcp does not exist
import org.apache.commons.dbcp.BasicDataSource;

And lot more similar errors.

Additionally, there are a huge number of ClassCastExceptions from javadoc.

java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl
at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
at com.sun.tools.doclets.internal.toolkit.util.Util.isDeprecated(Util.java:804)
at com.sun.tools.doclets.formats.html.TagletWriterImpl.deprecatedTagOutput(TagletWriterImpl.java:85)
at com.sun.tools.doclets.internal.toolkit.taglets.DeprecatedTaglet.getTagletOutput(DeprecatedTaglet.java:40)
at com.sun.tools.doclets.formats.html.MethodWriterImpl.writeDeprecated(MethodWriterImpl.java:166)
at com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder.buildDeprecationInfo(MethodBuilder.java:183)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder.invokeMethod(MethodBuilder.java:109)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractMemberBuilder.build(AbstractMemberBuilder.java:56)
at com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder.buildMethodDoc(MethodBuilder.java:150)
at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder.invokeMethod(MethodBuilder.java:109)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractMemberBuilder.build(AbstractMemberBuilder.java:56)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.buildMethodDetails(ClassBuilder.java:322)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.invokeMethod(ClassBuilder.java:101)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.buildClassDoc(ClassBuilder.java:124)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.invokeMethod(ClassBuilder.java:101)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:108)
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:155)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:177)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:161)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)

Activity

Hide
Olivier Lamy added a comment -

Hi,
I have the same trouble.
Does it works with add dependencies in the top pom ?
Just to test.

  • Olivier
Show
Olivier Lamy added a comment - Hi, I have the same trouble. Does it works with add dependencies in the top pom ? Just to test.
  • Olivier
Hide
Andrea Aime added a comment -

I do have the same problem, me too.
A quick search on the net releaved that we're not the only ones seeing this: http://jira.codehaus.org/browse/ANNOGEN-14

Show
Andrea Aime added a comment - I do have the same problem, me too. A quick search on the net releaved that we're not the only ones seeing this: http://jira.codehaus.org/browse/ANNOGEN-14
Hide
Jochen Wiedmann added a comment -

This did not work for me too, initially. However, after I forced an upgrade to the 2.0-final version of the javadoc plugin (by specifiying a version in the reports section for this plugin) everything works fine. See the SVN version of the Apache XML-RPC package.

Show
Jochen Wiedmann added a comment - This did not work for me too, initially. However, after I forced an upgrade to the 2.0-final version of the javadoc plugin (by specifiying a version in the reports section for this plugin) everything works fine. See the SVN version of the Apache XML-RPC package.
Hide
Andrea Aime added a comment -

I already updated to 2.0 final, yet the problem is still there...

Show
Andrea Aime added a comment - I already updated to 2.0 final, yet the problem is still there...
Hide
Eric Brown added a comment -

I'm experiencing this issue as well. I'm not sure how to upgrade to 2.0-final. I tried adding <version>2.0-final</version> inside <plugin></plugin>, but it still fails. I get:
GroupId: org.apache.maven.plugins
ArtifactId: maven-javadoc-pluginVersion: 2.0-final
Reason: Unable to download the artifact from any repository
org.apache.maven.plugins:maven-javadoc-plugin:pom:2.0-final

Doesn't sound like the solution anyway.

Show
Eric Brown added a comment - I'm experiencing this issue as well. I'm not sure how to upgrade to 2.0-final. I tried adding <version>2.0-final</version> inside <plugin></plugin>, but it still fails. I get: GroupId: org.apache.maven.plugins ArtifactId: maven-javadoc-pluginVersion: 2.0-final Reason: Unable to download the artifact from any repository org.apache.maven.plugins:maven-javadoc-plugin:pom:2.0-final Doesn't sound like the solution anyway.
Hide
Mathias Brökelmann added a comment -

This patch should fix the problem.

The problem was that the compile artifacts of the modules in the reactor where not initialized.

The solution in this patch is now to resolve the artifacts of each reactor project and add the compile artifacts to the classpath for javadoc generation. I've tested it with a large project structure (spring-rich) with multiple nested projects and it was working perfectly.

Show
Mathias Brökelmann added a comment - This patch should fix the problem. The problem was that the compile artifacts of the modules in the reactor where not initialized. The solution in this patch is now to resolve the artifacts of each reactor project and add the compile artifacts to the classpath for javadoc generation. I've tested it with a large project structure (spring-rich) with multiple nested projects and it was working perfectly.
Hide
Rohnny Moland (JIRA) added a comment -

I tried the patch from 20 august, and that seems to fix the problem. So I think this bug could be closed now.

Show
Rohnny Moland (JIRA) added a comment - I tried the patch from 20 august, and that seems to fix the problem. So I think this bug could be closed now.
Hide
Vincent Siveton added a comment -

Applied with small changes (codestyle)
Bump to 1.0-beta-2-SNAPSHOT for maven-plugin-testing-harness to prevent test failures.

Thanks Mathias!

Show
Vincent Siveton added a comment - Applied with small changes (codestyle) Bump to 1.0-beta-2-SNAPSHOT for maven-plugin-testing-harness to prevent test failures. Thanks Mathias!

People

Vote (7)
Watch (7)

Dates

  • Created:
    Updated:
    Resolved: