Maven javadoc plugin how to exclude generated source

Some moven plugins can generate additional source code, for example. jaxb2.

I want to skip genereating javadocs from the target/generated-sources directory.

How to configure maven-javadoc-plugin to achieve this? Maybe a different way?

+8
maven javadoc
source share
3 answers

Exists:

 <sourceFileExcludes> <sourceFileExclude>**/dir_name/*.java</sourceFileExclude> </sourceFileExcludes> 
+2
source share

A simple and effective solution is to generate code for a new package (for example: using ANTLR, move the grammar one level deeper, starting from your.package.here to the new package your.package.here.antlr ).

Then, using Andrew Rueckert's suggestion, add <excludePackageNames>*.antlr</excludePackageNames> to the maven javadoc plugin configuration in your pom file.

+1
source share

I am not sure if it is possible to exclude based on the directory, but you can use the <excludePackageNames> to exclude based on the package. (See the documentation .) Do you have auto-generated code in the same Java package?

0
source share

All Articles