The rule java:S1228 Packages should have a javadoc file ‘package-info.java’ does not work for generated sources.
We include generated sources in sonar analysis and then you get a false positive for every package in ‘target/generated-sources/annotations/’
So we have a package.info in src/main/java/com/foo
But it complains that one is missing in target/generated-sources/annotations/com/foo
The implementation of the rule S1228 does not support several source directories, it’s a bug. Ticket created SONARJAVA-3369. Meanwhile, you should mark issues as false-positive or disable this rule on this project.
Thanks for your feedback,
Alban
I retested it and it is fixed, but now I get a new violation by java:S4032. which seems to ignore that the package only contains generated sources. Curiously this only is flagged for 1 package, but I have two packages that only contain generated sources except the package-info.java.
Thanks for the confirmation. Ticket created: SONARJAVA-3633.
In addition, this is indeed strange that you don’t have an issue with both, but since we will probably have to rework this rule completely, we should not bother too much to understand the exact reason.