Maven 1.x Javadoc Plugin

I would like more control over the packages that javadoc uses to generate online documentation

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

Today the javadoc plugin takes the list of packages to be what is in the POM and it then appends ".*" on the end of pom.package.

In our case we will put "a.b.c" as the package but there are some sub-packages that should not be documented via javadoc. In this case I would like to be able to specify "a.b.c.d,a.b.c.e.f" as the list of packages to document.

I can suggest 2 possible ways to implement this:

1) If pom.package has a comma in it then don't add the ".*"

2) Add a new property for the plugin that overrides the pom.package if, and only if, it exists

Thanks,

Julian Payne

Activity

Hide
dion gillard added a comment -

Patches would help

Show
dion gillard added a comment - Patches would help
Hide
Ralph Apel added a comment -

If we define a package as a subdir containing .java files, the following scriptlet may iterate thru their package names:

<project default="default"
xmlns:j="jelly:core"
xmlns:u="jelly:util"
xmlns:ant="jelly:ant"
xmlns:maven="jelly:maven">

<goal name="packages:list">
<ant:fileScanner var="jfiles">
<fileset dir="src/java">
<include name="*/.java" />
</fileset>
</ant:fileScanner>
<j:useList var="pkgdirs" />
<j:forEach items="${jfiles.iterator()}" var="jfile">
<j:set var="pkgdir" value="${jfile.parentFile.path}" />
<j:if test="${!pkgdirs.contains(pkgdir)}" >
<j:set var="rc" value="${pkgdirs.add(pkgdir)}" />
</j:if>
</j:forEach>
<j:set var="rembase" value="${basedir}/src/java/" />
<j:forEach items="${pkgdirs.iterator()}" var="pkgd">
<j:set var="pkgreld" value="${pkgd.substring(rembase.length())}" />
<u:replace var="pkg" value="${pkgreld}" oldChar="/" newChar="." />
<echo>${pkg}</echo>
</j:forEach>
</goal>

Show
Ralph Apel added a comment - If we define a package as a subdir containing .java files, the following scriptlet may iterate thru their package names: <project default="default" xmlns:j="jelly:core" xmlns:u="jelly:util" xmlns:ant="jelly:ant" xmlns:maven="jelly:maven"> <goal name="packages:list"> <ant:fileScanner var="jfiles"> <fileset dir="src/java"> <include name="*/.java" /> </fileset> </ant:fileScanner> <j:useList var="pkgdirs" /> <j:forEach items="${jfiles.iterator()}" var="jfile"> <j:set var="pkgdir" value="${jfile.parentFile.path}" /> <j:if test="${!pkgdirs.contains(pkgdir)}" > <j:set var="rc" value="${pkgdirs.add(pkgdir)}" /> </j:if> </j:forEach> <j:set var="rembase" value="${basedir}/src/java/" /> <j:forEach items="${pkgdirs.iterator()}" var="pkgd"> <j:set var="pkgreld" value="${pkgd.substring(rembase.length())}" /> <u:replace var="pkg" value="${pkgreld}" oldChar="/" newChar="." /> <echo>${pkg}</echo> </j:forEach> </goal>

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated: