projectName not URL escaped for SonarQube Extension for VSTS-TFS


(Herbert Quartel) #1

Versions used

  • SonarQube 6.7.6
  • SonarQube Extension for VSTS-TFS 4.*

Problem

When using SonarQube Extension for VSTS-TFS in combination with maven (Run SonarQube or SonarCloud Analysis), the projectKey and projectName are adopted from the pom file, where projectName = project/name.

Name in the pom.xml can contain any character, like ^. (we have a ‘^’ in the <name> element, say
<name>ACME Widget^2</name>)

Since this value is use in the api call to ce (http://localhost:9000/api/ce/submit?projectKey=<groupId>:<artifactId>&projectName=<name> and these values are not URL escaped it results in a

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project : Fail to request … Software caused connection abort: socket write error -> [Help 1]

Solution

make sure to URL escape when using the value of the name in the pom file (I do not think the projectKey needs to be url escaped)