-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: sonar-plugin
-
None
During sonar analysis, the project link added to the build page is not computed as maven/sonar do : when the <name> tag (used to identify the project in sonar AND to generate the URL in the job page) contains some variables where the value is not directly set in this pom.xml (inherited from a parent). For instance:
<?xml version="1.0" encoding="windows-1250"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>myParentGroupId</groupId>
<artifactId>myParentArtifactId</artifactId>
<version>1.0.0</version>
</parent>
<name>${project.groupId}:${project.artifactId}</name>
<packaging>jar</packaging>
<artifactId>myArtifactId</artifactId>
<version>1.0.0</version>
</project>
Here the groupId is not defined as it is inherited by the parent pom, and this works perfectly with maven (artifacts built as expected) and sonar (report correctly generated)...BUT the sonar URL built by jenkins sonar plugin indicates : http://<host>:<port>/<context-root>/dashboard/index/null:<artifactId>.
If the <groupId> is added, then the URL is correctly generated.