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: 
I'm not sure if you can exclude based on directory, but you can use the `<excludePackageNames>` tag to exclude based on the package. (See [documentation](https://maven.apache.org/plugins/maven-javadoc-plugin/examples/exclude-package-names.html).) Does you autogenerated code all have the same Java package?
And another possible solution is to set `<sourceFileIncludes>`, e.g:

```
<sourceFileIncludes>**/com/pany/different/package/**/*.java</sourceFileIncludes>

```

Works only if your main source dirs ends differently from generated sources.