Using the Maven javadoc plugin you can exclude certain packages - but I have lots of packages and only a handful of classes I want to produce Javadoc for.
Is there a way to include rather than exclude?
I would also like to do things on a class level rather than a package level as I have some classes in a package which need javadoc and some which don't.
Since maven-javadoc-plugin version 2.9, you can do this in your configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
....
<sourceFileIncludes>
<include>Foo.java</include>
<include>Bar.java</include>
</sourceFileIncludes>
<sourcepath>${basedir}/src/main/java/path/to/foo-and-bar</sourcepath>
....
</configuration>
....
... which would build a Javadoc site only including the mentioned classes.