1: The project has several submodules but they’re displaying in SonarQube web as folders.
2: The (different) project and submodules all have the same name.
a: I’ve seen 2 different articles, one says you should NOT have a sonar.projectName property in
your pom.xml file and the other article says you DO need it.
Some guidance on where the <sonar.projectName> property needs to be would be appreciated.
Regarding 1: Yes, that is the default behavior. A Maven multi-module project is treated as 1 SonarQube project. Sub-modules are displayed as folders in the “Code” section in the SonarQube Web-UI.
Did you expect something different (e.g. every sub-module as separate SonarQube project?)
Regarding 2: I recommend to not use sonar.projectName. SonarQube picks-up the property from the pom.xml and uses this as display name in the Web-UI for your project.
This does not work for sub-modules: They will still be displayed by their folder name.
In general you can omit most of the sonar-properties, when using Maven and you have a standard directory layout in your project.
We use the sonar.projectName only in combination with the SonarScanner, when no build tool can be used.
Please forgive my ignorance, I’m not very familiar with SonarQube and Maven integration yet. Why is one project displaying folders and the other displaying (what I assume are) submodules? See screenshots attached. Is it a specific property or parameter in the pom.xml that is causing this?
Hi @DevonBritton,
I never experienced this: All my sub-modules are displayed as folders.
But I would be interested in the explanation, why sub-modules are displayed as projects?
Did you try to add the tag in the pom.xml in one of the sub-modules, to see if the display name changes in the SonarQube UI?