1

Having a multi-module maven project, where some modules compile with jdk 1.4, and some with 1.7. Compiler plugin is setup in different parents, so this works well for maven.

Unfortunately, Sonar still complains about missing override annotations (which are not possible at 1.4), so it seems not to see that configuration?!

So how can i setup sonar/build to correctly recognise this? Currently running sonar on Jenkins with post-build action; (there's only a "JDK inherit from job" setting, but not on module basis)

Myron
  • 23
  • 1
  • 4
  • There is a problem with rule squid:S1161 ("@Override” annotation should be used on any method) when you analyze projects build by JDK5 or smaller (see [How to enforce the correct behavior for the squid:S1161 rule: “@Override” annotation should be used on any method](http://stackoverflow.com/questions/31460783/how-to-enforce-the-correct-behavior-for-the-squids1161-rule-override-annota)) – agabrys Sep 30 '15 at 10:28

1 Answers1

0

In order to address this for the moment you would have to tune the quality profile used by your modules to activate/deactivate rules depending on the jdk. But as of now, this is completely relying on user configuration.

However, we (SonarSource team working on java analyzer) have in mind at one point to use the fact that we know about the source level of the analysis and report issues only if they are relevant (so even if the rule is activated on your java 1.4 project, no issues would be raise) but this is a feature to be implemented and is not available now.

benzonico
  • 10,635
  • 5
  • 42
  • 50