Sonarqube doesn't allow slash in project key

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube Server 7.9.4 (build 35981) Community Edition
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
    Since the last update I get an error message that a slash is not allowed in the project key:
Malformed key for Project: '<prefix>:bugfix/<branch name>'. Allowed characters are alphanumeric, '-', '_', '.' and ':', with at least one non-digit.

In the version we use before the update the slash was allowed. Is there any reason why it is not longer allowed or is the a bug?

I am creating the project using the maven plugin from jenkins

SONAR-13160 has changed the list of allowed characters from:

Allowed characters are alphanumeric, β€˜-’, β€˜_’, β€˜.’ and β€˜/’

to

Allowed characters are alphanumeric, β€˜-’, β€˜_’, β€˜.’ and β€˜:’, with at least one non-digit

See commit: ec384a1e6926c801dc5167807f26b1f2ef6baf84.

The change has been introduced in 7.9.3. I found documentation of projectKey for the first time in 7.2:

The project key that is unique for each project.
Allowed characters are: letters, numbers, β€˜-’, β€˜_’, β€˜.’ and β€˜:’, with at least one non-digit.

When using Maven, it is automatically set to <groupId>:<artifactId>.

The answer to your question is:

Allowing slash characters in projectKey was a bug which has been fixed in 7.9.3

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.