SonarQube projectBaseDir set to the first module on the list

Hi, Sonar community!

I’m running into problem trying to execute Sonar on multimodule Maven project from Jenkins. Im using Sonar Maven plugin Sonar works perfectly fine when I don’t specify sonar.modules property, but when I do, it wrongly sets whole projects base directory to the first module’s base directory. My goal is to be able to set custom properties for each module, for example, name and sources directory. As far I as can understand right now, you can only achieve it by specifying modules property first - correct me if Im wrong. Also found same, but old dated issue, but couldn’t find any workarounds or fixes -

P.S. sonar:sonar gave me exact same result

Thank you in advance!


maybe this thread with a similar problem may be helpful




Welcome to the community!

In addition to Gilbert’s helpful reference, I want to point out that with a Maven analysis (mvn sonar:sonar, right?) there’s no need to specify sonar.modules; the Maven-based analysis handles that for you. sonar.modules is provided for those times when you can’t analyze with Maven.


1 Like

Hi, Ann and Gilbert!

Reading through the given reference and many other links on the web, I came to conclusion that I should rather play around in pom files than trying to set arguments to ‘mvn sonar:sonar -Dsonar.projectKey…’ It did work for me and indeed no need to specify modules anywhere. I suppose this is the correct way to work with Maven projects (Im newbie in maven myself as well), setting everything you need in pom files, but Im kinda intrigued with this interesting (I wanna call it) bug I was able to encounter.

Thank you both anyways, these were really quick responses!

Hope this won’t be only useful for myself,

1 Like