0

I only want to document two classes from a package. In standard javadoc tool, it would be something like: C:> javadoc -d C:\home\html C:\home\src\java\awt\classA.java C:\home\src\java\awt\classB.java

How can I do it in maven-javadoc-plugin?

bridget
  • 1
  • 1
  • Did you try configuring that plugin in your project's POM? – sherb Oct 20 '14 at 21:35
  • I went through the parameter list here: https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html. That's what they allow you to put in the , correct? Didn't see any parameter for allowing individual classes. Did I miss anything? – bridget Oct 20 '14 at 21:56

1 Answers1

0

sourceFileIncludes should do what you're looking for.

https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#sourceFileIncludes

Here's an example:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.10.1</version>
    <configuration>
        <sourceFileIncludes>
            <include>com/mycompany/myproject/MyClass.java</include>
        </sourceFileIncludes>
    </configuration>
</plugin>

UPDATE:

I tried this out on one of my maven projects and it worked at the package level, but not on individual classes. It looks like these open Maven issues are the cause:

http://jira.codehaus.org/browse/MJAVADOC-388

http://jira.codehaus.org/browse/MJAVADOC-365

Note that issue #365 is actually related to sourceFileExcludes; the fix for that is scheduled for maven-javadoc-plugin 2.11.

sherb
  • 5,845
  • 5
  • 35
  • 45
  • Thanks, this does add the class file I want to include. But at the same time, all the other classes from other packages are still there. I only want to have two classes from one of the packages shown. – bridget Oct 21 '14 at 22:54