Maven generates needless javadocs for generated classes

J

Jukka Lahtinen

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

Jukka Lahtinen

Jukka Lahtinen said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top