1. My project is maven project, it include many modules. Its pom.xml is like:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>steve.test</groupId>
<artifactId>main</artifactId>
...
<modules>
<module>../module1</module>
<module>../module2</module>
</modules>
</project>
2. In jenkins we create a job and add the sonar maven plugin, then set the property of “Addition properties”, the following is its content:
-Dmaven.test.failure.ignore=true -Dsonar.projectKey=stevetest -Dsonar.projectName=stevetest -Dsonar.java.coveragePlugin=jacoco -Dsonar.jacoco.reportMissing.force.zero=true
3. Run jenkins, generate sonar report, we found an issue. This maven project includes two child modules(module1, module2), but on sonar report, these two modules can be shown, but their names are same, and it is changed to project key.
4. if I do't set sonar.projectKey and sonar.projectName for jenkins sonar plugin, generate sonar report is ok/
Thanks!
Steve