Question: Some maven plugin can generate additional source code e.g., jaxb2.

I want to skip generating javadocs from `target/generated-sources` directory.

How to configure `maven-javadoc-plugin` to achieve this? Maybe there is some other way?

Answer: 
There is:

```
<sourceFileExcludes>
        <sourceFileExclude>**/dir_name/*.java</sourceFileExclude>
</sourceFileExcludes>

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

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