I need to exclude specific source files (NOT just packages) from Javadoc using Maven. The <excludePackageNames> setting will not work for me: it only allows you to exclude certain packages. There's a <sourceFileExcludes> setting that has basically no documentation in the way of usage examples. It just says:
"sourceFileExcludes: exclude filters on the source files. These are ignored if you specify subpackages or subpackage excludes."
So, basically, I need to ignore all Java files that start with Mock, and also all Java files in two packages. Since sourceFileExcludes are ignored if I specify excludePackageNames, I can't combine them. So I tried this:
<sourceFileExcludes>
<exclude>net/my/packagename/mock</exclude>
<exclude>net/my/packagename/samples</exclude>
<exclude>**/Mock*.java</exclude>
</sourceFileExcludes>
But it did not work. None of the intended files were excluded.
Anybody know how to use sourceFileExcludes?
It might just not be working at the moment. There is bug logged in the plugin issue tracker - MJAVADOC-365
And what about this?
<sourceFileExcludes>
<exclude>net/my/packagename/mock/*.java</exclude>
<exclude>net/my/packagename/samples/*.java</exclude>
<exclude>**Mock*.java</exclude>
</sourceFileExcludes>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With