if you do not want Sonarqube to create an aggregated project for your Maven multi-module project,
you need to ‘dir’ into each submodule and start a separate analysis for it.
here is some - very simplified - snippet from a Jenkins pipelline
Thank you for the response, I guess your response confirms what I was seeing is that there is no real way to easily integrate SonarQube into an existing large Maven project and have it analyze them as separate SonarQube projects. I was really hoping to be able to add a profile at the parent level and just call my sonar profile from the repo parent with the fictious option aggregate=false Note: the below is wish, the aggregate flag does not exist
mvn verify -P sonar -Dsonar.aggregate=false
Based on your code, I am guessing you only have one parent project with modules? Our repo has multiple levels of parent projects so I think my script would need to be able to skip those.
Also, thank you for sharing your Jenkins pipeline, we use GitLab, you inadvertently answered another question I had about all my projects reporting as main even when on a different branch, looks like I need to set the sonar.branch.name to be able to get could analysis as well.