Maven generates needless javadocs for generated classes

Discussion in 'Java' started by Jukka Lahtinen, Feb 22, 2011.

  1. 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
     
    Jukka Lahtinen, Feb 22, 2011
    #1
    1. Advertising

  2. Jukka Lahtinen <> 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
     
    Jukka Lahtinen, Feb 24, 2011
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ahmed Moustafa
    Replies:
    3
    Views:
    373
    Ahmed Moustafa
    Sep 5, 2003
  2. Joona I Palaste

    Needless casts?

    Joona I Palaste, Apr 24, 2004, in forum: Java
    Replies:
    15
    Views:
    692
    Icemerth
    Apr 25, 2004
  3. Marcin Cenkier
    Replies:
    1
    Views:
    5,424
    Marcin Cenkier
    Apr 12, 2006
  4. James Stroud

    Needless copying in iterations?

    James Stroud, Sep 15, 2007, in forum: Python
    Replies:
    22
    Views:
    636
    =?ISO-8859-1?Q?BJ=F6rn_Lindqvist?=
    Sep 17, 2007
  5. manos
    Replies:
    0
    Views:
    233
    manos
    Oct 6, 2007
Loading...

Share This Page