-
which versions I am using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube : Version 5.6.3 - Community
jacoco-maven-plugin : 0.8.3
sonar-maven-plugin: 3.6.0.1398 -
what are you trying to achieve
code coverage and code quality analysis of our multi maven java project -
what have you tried so far to achieve this
- added and execute the jacoco-maven-plugin and sonar-maven-plugin during our Jenkins nitghtly maven builds.
installed sonarQube server
- added and execute the jacoco-maven-plugin and sonar-maven-plugin during our Jenkins nitghtly maven builds.
All seems to work correctly except for 1 thing:
the maven module names are not correctly displayed in the sonarqube top level dashboard projects widget when I drill down from the project to the module level:
module level for project vp-parent_6.2:
The problem: all Maven modules get the the same name as the parent project.
This is how we call sonar from Jenkins build config:
Maven 3.3.9 task with these goals : sonar:sonar-Dsonar.projectName=vp-parent_6.2-Dsonar.projectKey=vp-parent_6.2-Dsonar.cpd.exclusions=**/*
This is the maven config for sonar and jacoco:
…
…
<!-- jacoco plugin for determining the unit test code coverage -->
<!-- Testing: Visualize code coverage for tests -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.3</version>
<configuration>
<destFile>${sonar.jacoco.reportPath}</destFile>
<append>true</append>
</configuration>
<executions>
<execution>
<id>agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- sonar plugin for enabling code coverage analysis -->
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.6.0.1398</version>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<!-- support java 8 -->
<version>5.5.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<pluginManagement>
<plugins>
…
…
org.jacoco
jacoco-maven-plugin
0.8.3
${sonar.jacoco.reportPath}
true
agent
prepare-agent
<!-- sonar plugin for enabling code coverage analysis -->
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.6.0.1398</version>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<!-- support java 8 -->
<version>5.5.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
…
…
What do I need to change to get Sonarqube report the module names properly???
Regards,
Jan van de klok