f



Maven generates needless javadocs for generated classes

I'm working on a multi-module project that is build with maven and run
on IBM WAS 6 server. 
We used to use a plugin made in-house for deploying to WAS back when we
used maven 2.2.1 for the builds, but I encountered some problems with
transitive dependencies when upgrading to maven 3, and found switching
to org.codehaus.mojo:was6-maven-plugin easier than trying to get the
in-house plugin to work. 
Now I have noticed that when I generate the javadocs (with
javadoc:aggregate from the multiproject directory), I end up having
javadocs for not only the classes written and maintained by ourselves,
but also for the classes generated by the deployment plugin. They just
needlessly clutter up the class list, nobody here is really interested
in the javadocs for generated classes anyway.

was6-maven-plugin generates the deployment sources in
target/generated-sources under each subproject directory and they seem
to be included in the -sourcepath option for the javadoc generation, is
there a way to leave them out and only generate from the src directory
of each project? 
Or to at least skip every source file beginning with "EJS" (those
classes are all generated by the deployment plugin)? 

The only helpful option I found in the javadoc plugin documentation at 
http://maven.apache.org/plugins/maven-javadoc-plugin/aggregate-mojo.html 
was excludePackageNames, but most of the generated classes use the same
package names as our own classes.
I have tried the -Dwas6.skip command line parameter, but it didn't help.

-- 
Jukka Lahtinen
0
Jukka
2/22/2011 12:57:39 PM
comp.lang.java.programmer 52696 articles. 0 followers. Post Follow

1 Replies
357 Views

Similar Articles

[PageSpeed] 42

Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> writes:

> I'm working on a multi-module project that is build with maven and run
> on IBM WAS 6 server. 
> Now I have noticed that when I generate the javadocs (with
> javadoc:aggregate from the multiproject directory), I end up having
> javadocs for not only the classes written and maintained by ourselves,
> but also for the classes generated by the deployment plugin. They just
...
> was6-maven-plugin generates the deployment sources in
> target/generated-sources under each subproject directory and they seem
> to be included in the -sourcepath option for the javadoc generation, is
> there a way to leave them out and only generate from the src directory
> of each project? 

OK, I tried adding the sourcepath element to the javadoc plugin
configuration to override the maven default, and it worked. This is just
a little bit ugly, because I had to define it like 
${project.basedir}/module1/src/main/java;${project.basedir}/module2/src/main/java;...
listing the source directories for each of the 16 subprojects defined
within the modules element (represented here with "module1" and
"module2"), making the sourcepath element in the pom.xml uncomfortably
long.
I also tried
${project.basedir}/src/main/java;${project.basedir}/*/src/main/java;
but it didn't seem to work.

> Or to at least skip every source file beginning with "EJS" (those
> classes are all generated by the deployment plugin)? 

I would really prefer having some javadoc option like
-excludeclass EJS*
but the -exclude option seems to only exclude whole packages, not
classnames defined with a pattern.

-- 
Jukka Lahtinen
0
Jukka
2/24/2011 7:27:00 AM
Reply: