8

We currently use the sonar-scanner utility to run sonar analysis on our maven multi-modules java project.

I wanted to move from the sonar-scanner to the sonar-maven-plugin, but the first tests shows a big discrepancy in the reported metrics.

For example the number of lines of code went from 466'000 to 154'000.

The main difference seems to be that the maven plugin does not analyse the src/test directories whereas the scanner does. Another reason could be that the maven plugin only analyses the modules which are enabled.

Do this behavior seems normal to you ?

or did I miss some configuration in the plugin or the scanner. They both should pull the config from our sonarqube server.

If this is the normal behavior then should I stay with the scanner and keep the metrics history or should I start over with the maven plugin ? I could redo some analysis for all versions we released to have some comparisons and trends.

Thanks for your advices.

Update: Settings the sonar.sources and sonar.inclusions like mentioned there gives some better results...
sonar-maven-plugin: extending sonar.sources in multi-module project

Community
  • 1
  • 1
Julien
  • 206
  • 1
  • 7

0 Answers0