Sonar maven module: does the same project key for all modules not work?

I am using sonar-maven-plugin 3.2 and maven 3.3.9. In the parent POM, I have the sonar.projectKey maven property defined. The meaning is valid, I see it from the sonar printout. But mvn sonar crashes: sonar does not work because maven modules use the same project key value because the maven property has the same value in all modules. Sonar gives an error:

The project "..." cannot have 2 modules with the following key: ...

Is there really no way to create one sonar project containing all maven modules? Should all modules be really different sonar projects?

I know that I can use the asa hack branch property, but I would like to avoid this. If there is a way to have a maven multi module project in a single-project sonar containing all maven modules, this would be best ...

+5
source share
3 answers

According to SonarQube analysis parameters :

sonar.projectKey

A project key unique to each project. Valid characters: letters, numbers, '-', '_', '.' and ':' with at least one digit.
When using Maven, it is automatically installed for it <groupId>:<artifactId>.

Therefore, delete the configuration sonar.projectKeyand it should work.

(I went through the same loop).

+5

. , . . " b" " b".

0

, , . parent.pom :

<properties>
    <sonar.projectKey>
        YourKey
    </sonar.projectKey>
    <sonar.moduleKey>
        ${artifactId}
    </sonar.moduleKey>
</properties>

. Sonar, projectKey projectKey. , :

[INFO] Reactor Summary:
[INFO] 
[INFO] parent ................................. SUCCESS [01:14 min]
[INFO] module1................................. SKIPPED
[INFO] module2 ................................ SKIPPED
[INFO] module3 ................................ SKIPPED

, , .

0
source

Source: https://habr.com/ru/post/1675679/


All Articles