Hi to everyone.
I use sonar-maven-plugin (3.6.0.1398)
So I have a multi module maven project and my goal is to analyze code of every module separately and see it on server as individual project.
Ок, what am I doing… I put properties of my sonar confguration at maven specific profile (“sonar”) and plugin configuration to plugin management section of this profile. In one module (I choose it randomly) I activate the plugin, so I run the build process and expect that some analyze will be perform and some stuff wii be send to sonar server but in build output i see only this
[INFO] — sonar-maven-plugin:3.6.0.1398:sonar (default) @ %my_module_name% —
[INFO] Delaying SonarQube Scanner to the end of multi-module project
I suppose that sonar maven plugin can’t do things that i talked above, cause it start his work from root context every time. I do not understand why you have done it this way? It is unconvinient on my look. Could you explain? Thnx
There is a workaround that should allow your specific case.
I assume you currently run the sonar maven goal in the root of your project, one thing you can do is execute the goal specific for the module you want.
I don’t know the specifics of your project setup, but lets assume the following as example:
To run the scanner for a single module, you could limit the build context of maven by only running the scanner a specific module. Lets say you only want to scan module-2.1 then you can execute the goal from the root of the module by executing
cd module-2/module-2.1
mvn sonar:sonar
Alternatively you can also execute it from the root context using the project selector by artifactId