0
votes

I have a multi module project set up for sonar analysis using way #2 from Analyzing with SonarQube Runner.

The only difference is that I dont use a global sonar-project.properties file. The global properties are defined in jenkins in the sonar runner build step.

This works perfectly fine with Sonar Runner 2.3. As soon as I switch from 2.3 to Sonar Runner 2.4 this fails with the error that the mandatory sonar.sources property is not defined.

I have tried setting it in my global properties to sonar.sources=src but then sonar can't analyze a module that doesn't use src as source folder.

It looks to me like Sonar Runner 2.4 doesn't use the module's sonar-project properties anymore.

Or is there a way to tell Sonar Runner 2.4 to use the module's sonar-project.properties file?

1

1 Answers

1
votes

The two supported layout when using SQ Runner are:

  • put all properties of all modules in root sonar-project.properties file
  • put each module properties in its own sonar-project.properties in addition to the root sonar-project.properties

It is also possible to add properties via command line (this is what you do when you define properties in SQ Runner build step).

Your attempt to not have a root sonar-project.properties but having individual sonar-project.properties files in sub modules was not identified as a supported use case. So I'm not very surprised it is no more supported (it was likely a side effect).

See http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Runner#AnalyzingwithSonarQubeRunner-Multi-moduleProject