You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Adam Hardy <ad...@cyberspaceroad.com> on 2007/06/16 20:21:09 UTC

Re: using javadocDirectory with maven-javadoc-plugin

Heinrich Nirschl on 15/06/07 18:35, wrote:
> On Thu, 2007-06-14 at 23:07 +0100, Adam Hardy wrote:
>> I thought I'd post a more generic description since it seems no-one else 
>> recognises the problem.
>>
>> Can't find any references to it in the JIRA or on the mailing list or in fact 
>> just generally by googling (there is some stuff but it was for mvn 1.1 and fixed).
>>
>> Using the src/main/javadoc directory for package.html files just doesn't work.
>>
>> Does anyone successfully process their package.html and images etc from 
>> src/main/javadoc? I'd be interested to hear.
>>
>> Thanks
>> Adam
>>
> 
> Yes, this works here (Java 5, Maven 2.0.6, javadoc plugin 2.2). At least
> the package.html bit, I did not try images. There is an issue with
> aggregated documentation
> ( http://jira.codehaus.org/browse/MJAVADOC-118 ) but this should not
> apply to your case.

Henry,

how are you specifying the maven-javadoc-plugin config?

Do you have the src/main/javadoc directory declared in <sourcepath/> or in 
<javadocDirectory/> or not declared at all?

I realised that javadoc would have no problem processing the package.html files 
if I declared the src/main/javadoc in the <sourcepath/> but that is just a 
work-around, since it would make <javadocDirectory/> redundant - or am I missing 
something?

Thanks for the pointer to the bug. I tried using the src/main/javadoc dir 
structure in a multi-module project and the directory wasn't processed, 
unfortunately. You say you are using plugin 2.2 but the fix for the bug is in 
2.3 - so you must be using src/main/javadoc only in the parent project?


regards
Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: using javadocDirectory with maven-javadoc-plugin

Posted by Adam Hardy <ad...@cyberspaceroad.com>.
Heinrich Nirschl on 22/06/07 16:59, wrote:
> On Thu, 2007-06-21 at 23:22 +0100, Adam Hardy wrote:
>> I couldn't get it to work. I am glad it doesn't affect you, but I found nothing 
>> to explain why. BTW I am on linux too.
>>
>> I filed the bug http://jira.codehaus.org/browse/MJAVADOC-129 with a testcase.
>>
> 
> I tried your test case, but I get a stack trace from javadoc after a few
> error messages (this is with java version 1.5.0_11):
> 
> 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)
> ...

That's right. It's the junit annotations in the unit test class that javadoc 
can't handle because the junit.jar is not passed to javadoc in the classpath. I 
don't think javadoc should react like this, it should handle it more gracefully. 
Here's a link to the bug at Sun (not mine!):

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6442982




Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: using javadocDirectory with maven-javadoc-plugin

Posted by Heinrich Nirschl <he...@gmail.com>.
On Thu, 2007-06-21 at 23:22 +0100, Adam Hardy wrote:
> I couldn't get it to work. I am glad it doesn't affect you, but I found nothing 
> to explain why. BTW I am on linux too.
> 
> I filed the bug http://jira.codehaus.org/browse/MJAVADOC-129 with a testcase.
> 

I tried your test case, but I get a stack trace from javadoc after a few
error messages (this is with java version 1.5.0_11):

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)
...

When I remove the test directory src/test/java from the sourcepath it
finishes without error but the package.html file is not picked up. So
far that's consistent with your observations.

If I remove the sourcepath completely, I get the package.html but not
the image in doc-files.

The doc-files directory does show up in the generated documentation if
it is moved to the root (i.e. src/main/javadoc/doc-files).

Seems, there are quite a few bugs at work ...

- Henry


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: using javadocDirectory with maven-javadoc-plugin

Posted by Adam Hardy <ad...@cyberspaceroad.com>.
Heinrich Nirschl on 16/06/07 21:39, wrote:
> On Sat, 2007-06-16 at 19:21 +0100, Adam Hardy wrote:
>> Heinrich Nirschl on 15/06/07 18:35, wrote:
>>> On Thu, 2007-06-14 at 23:07 +0100, Adam Hardy wrote:
>>>> I thought I'd post a more generic description since it seems no-one else 
>>>> recognises the problem.
>>>>
>>>> Can't find any references to it in the JIRA or on the mailing list or in fact 
>>>> just generally by googling (there is some stuff but it was for mvn 1.1 and fixed).
>>>>
>>>> Using the src/main/javadoc directory for package.html files just doesn't work.
>>>>
>>>> Does anyone successfully process their package.html and images etc from 
>>>> src/main/javadoc? I'd be interested to hear.
>>>>
>>>> Thanks
>>>> Adam
>>>>
>>> Yes, this works here (Java 5, Maven 2.0.6, javadoc plugin 2.2). At least
>>> the package.html bit, I did not try images. There is an issue with
>>> aggregated documentation
>>> ( http://jira.codehaus.org/browse/MJAVADOC-118 ) but this should not
>>> apply to your case.
>>
>> how are you specifying the maven-javadoc-plugin config?
>>
>> Do you have the src/main/javadoc directory declared in <sourcepath/> or in 
>> <javadocDirectory/> or not declared at all?
> 
> I do not declare the src/main/javadoc anywhere. It works out of the box.
> By the way, am working on Linux, this may also be relevant.
> 
>> I realised that javadoc would have no problem processing the package.html files 
>> if I declared the src/main/javadoc in the <sourcepath/> but that is just a 
>> work-around, since it would make <javadocDirectory/> redundant - or am I missing 
>> something?
> 
> You may experiment with the debug parameter of the javadoc plugin. This
> will reveal the javadoc command actually used. Maybe you can find out
> why your setup does not work.

I couldn't get it to work. I am glad it doesn't affect you, but I found nothing 
to explain why. BTW I am on linux too.

I filed the bug http://jira.codehaus.org/browse/MJAVADOC-129 with a testcase.


Regards
Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: using javadocDirectory with maven-javadoc-plugin

Posted by Heinrich Nirschl <he...@gmail.com>.
On Sat, 2007-06-16 at 19:21 +0100, Adam Hardy wrote:
> Heinrich Nirschl on 15/06/07 18:35, wrote:
> > On Thu, 2007-06-14 at 23:07 +0100, Adam Hardy wrote:
> >> I thought I'd post a more generic description since it seems no-one else 
> >> recognises the problem.
> >>
> >> Can't find any references to it in the JIRA or on the mailing list or in fact 
> >> just generally by googling (there is some stuff but it was for mvn 1.1 and fixed).
> >>
> >> Using the src/main/javadoc directory for package.html files just doesn't work.
> >>
> >> Does anyone successfully process their package.html and images etc from 
> >> src/main/javadoc? I'd be interested to hear.
> >>
> >> Thanks
> >> Adam
> >>
> > 
> > Yes, this works here (Java 5, Maven 2.0.6, javadoc plugin 2.2). At least
> > the package.html bit, I did not try images. There is an issue with
> > aggregated documentation
> > ( http://jira.codehaus.org/browse/MJAVADOC-118 ) but this should not
> > apply to your case.
> 
> Henry,
> 
> how are you specifying the maven-javadoc-plugin config?
> 
> Do you have the src/main/javadoc directory declared in <sourcepath/> or in 
> <javadocDirectory/> or not declared at all?

I do not declare the src/main/javadoc anywhere. It works out of the box.
By the way, am working on Linux, this may also be relevant.

> 
> I realised that javadoc would have no problem processing the package.html files 
> if I declared the src/main/javadoc in the <sourcepath/> but that is just a 
> work-around, since it would make <javadocDirectory/> redundant - or am I missing 
> something?

You may experiment with the debug parameter of the javadoc plugin. This
will reveal the javadoc command actually used. Maybe you can find out
why your setup does not work.

> 
> Thanks for the pointer to the bug. I tried using the src/main/javadoc dir 
> structure in a multi-module project and the directory wasn't processed, 
> unfortunately. You say you are using plugin 2.2 but the fix for the bug is in 
> 2.3 - so you must be using src/main/javadoc only in the parent project?

I don't use aggregation for the moment (until version 2.3 is out). If
this is too inconvenient, I just put package.html below src/main/java.
Your approach with the sourcepath seems more elegant.

- Henry



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org