You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Russell Gold <ru...@gold-family.us> on 2013/03/20 13:53:55 UTC

Test Javadoc generation by default?

Hi,

I started using the javadoc reporting plugin and noticed that by default it generates test javadocs as well as regular ones. I know that I can configure it only to produce the regular ones, but I was wondering if somebody could explain why the defaults are as they are. Do most projects want their unit tests documented via Javadoc?

Thanks,
Russ
-----------------
Come read my webnovel, Take a Lemon <http://www.takealemon.com>, 
and listen to the Misfile radio play <http://www.gold-family.us/audio/misfile.html>!





Re: Test Javadoc generation by default?

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Russ,

Thanks. After running "mvn site" with your project, here's what I see:

$ find target -name '[A-Z]*.html'
target/site/apidocs/com/meterware/codebreaker/class-use/Codebreaker.html
target/site/apidocs/com/meterware/codebreaker/Codebreaker.html
target/site/testapidocs/com/meterware/codebreaker/class-use/CodebreakerTest.html
target/site/testapidocs/com/meterware/codebreaker/class-use/MatcherTest.html
target/site/testapidocs/com/meterware/codebreaker/class-use/ResultTest.html
target/site/testapidocs/com/meterware/codebreaker/CodebreakerTest.html
target/site/testapidocs/com/meterware/codebreaker/MatcherTest.html
target/site/testapidocs/com/meterware/codebreaker/ResultTest.html

So yeah, you're right. The test classes do have javadoc generated, but they
go into a separate directory space. That is, they aren't mixed in with the
main class docs. I actually never noticed this behavior with my projects
because of the separate directory structure (Jenkins only publishes the
target/site/apidocs folder).

Seems it's been this way for quite a while; Anders answered a similar
question<http://mail-archives.apache.org/mod_mbox/maven-users/201001.mbox/%3Cfabd12811001032136r7852fdecndd31cdcbefaf7d5@mail.gmail.com%3E>back
in 2010, and presumably it was a FAQ even before that.

> I know that I can configure it only to produce the regular ones

Yeah, like this, right?
http://maven.apache.org/plugins/maven-javadoc-plugin/faq.html#How_to_remove_test_Javadocs_report

> I was wondering if somebody could explain why the defaults are as they
> are. Do most projects want their unit tests documented via Javadoc?

I certainly don't need it for my projects. And I couldn't tell you the
plugin authors' rationale. But from my perspective, the overhead of
generating the test javadocs is fairly low, since typically the unit test
class hierarchy is smaller than that of the main project...

Regards,
Curtis


On Wed, Mar 20, 2013 at 11:32 AM, Russell Gold <ru...@gold-family.us> wrote:

> Hi Curtis,
>
> I've posted a small project with this behavior at <
> http://www.gold-family.us/russ/lines/sample8.zip>
>
> Thanks,
> Russ
>
> On Mar 20, 2013, at 11:54 AM, Curtis Rueden <ct...@wisc.edu> wrote:
>
> > Hi Russ,
> >
> >> I started using the javadoc reporting plugin and noticed that by
> >> default it generates test javadocs as well as regular ones.
> >
> > Do you mean maven-javadoc-plugin? If so, that is strange... I regularly
> > generate full javadoc with v2.8.1 for several different multi-module
> > projects and it only generates the javadoc for the main classes, not test
> > classes. Perhaps you could post an small example project somewhere that
> > demonstrates the behavior you are seeing?
> >
> > Regards,
> > Curtis
> >
> >
> >
> > On Wed, Mar 20, 2013 at 7:53 AM, Russell Gold <ru...@gold-family.us>
> wrote:
> >
> >> Hi,
> >>
> >> I started using the javadoc reporting plugin and noticed that by default
> >> it generates test javadocs as well as regular ones. I know that I can
> >> configure it only to produce the regular ones, but I was wondering if
> >> somebody could explain why the defaults are as they are. Do most
> projects
> >> want their unit tests documented via Javadoc?
> >>
> >> Thanks,
> >> Russ
> >> -----------------
> >> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> >> and listen to the Misfile radio play <
> >> http://www.gold-family.us/audio/misfile.html>!
> >>
> >>
> >>
> >>
> >>
>
> -----------------
> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> and listen to the Misfile radio play <
> http://www.gold-family.us/audio/misfile.html>!
>
>
>
>
>

Re: Test Javadoc generation by default?

Posted by Russell Gold <ru...@gold-family.us>.
Hi Curtis,

I've posted a small project with this behavior at <http://www.gold-family.us/russ/lines/sample8.zip>

Thanks,
Russ

On Mar 20, 2013, at 11:54 AM, Curtis Rueden <ct...@wisc.edu> wrote:

> Hi Russ,
> 
>> I started using the javadoc reporting plugin and noticed that by
>> default it generates test javadocs as well as regular ones.
> 
> Do you mean maven-javadoc-plugin? If so, that is strange... I regularly
> generate full javadoc with v2.8.1 for several different multi-module
> projects and it only generates the javadoc for the main classes, not test
> classes. Perhaps you could post an small example project somewhere that
> demonstrates the behavior you are seeing?
> 
> Regards,
> Curtis
> 
> 
> 
> On Wed, Mar 20, 2013 at 7:53 AM, Russell Gold <ru...@gold-family.us> wrote:
> 
>> Hi,
>> 
>> I started using the javadoc reporting plugin and noticed that by default
>> it generates test javadocs as well as regular ones. I know that I can
>> configure it only to produce the regular ones, but I was wondering if
>> somebody could explain why the defaults are as they are. Do most projects
>> want their unit tests documented via Javadoc?
>> 
>> Thanks,
>> Russ
>> -----------------
>> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
>> and listen to the Misfile radio play <
>> http://www.gold-family.us/audio/misfile.html>!
>> 
>> 
>> 
>> 
>> 

-----------------
Come read my webnovel, Take a Lemon <http://www.takealemon.com>, 
and listen to the Misfile radio play <http://www.gold-family.us/audio/misfile.html>!





Re: Test Javadoc generation by default?

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Russ,

> I started using the javadoc reporting plugin and noticed that by
> default it generates test javadocs as well as regular ones.

Do you mean maven-javadoc-plugin? If so, that is strange... I regularly
generate full javadoc with v2.8.1 for several different multi-module
projects and it only generates the javadoc for the main classes, not test
classes. Perhaps you could post an small example project somewhere that
demonstrates the behavior you are seeing?

Regards,
Curtis



On Wed, Mar 20, 2013 at 7:53 AM, Russell Gold <ru...@gold-family.us> wrote:

> Hi,
>
> I started using the javadoc reporting plugin and noticed that by default
> it generates test javadocs as well as regular ones. I know that I can
> configure it only to produce the regular ones, but I was wondering if
> somebody could explain why the defaults are as they are. Do most projects
> want their unit tests documented via Javadoc?
>
> Thanks,
> Russ
> -----------------
> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> and listen to the Misfile radio play <
> http://www.gold-family.us/audio/misfile.html>!
>
>
>
>
>