SonarQube scan fails with "already part of project error XXX, already part of project"

I recently upgraded sonarqube from 4.0 to 4.3.3. Post update when I try to run maven build I get the error:

Failed to execute target org.codehaus.mojo: sonar-maven-plugin: 2.4: sonar (default-cli) in project xxx in project yyy The module "abc.def.xyz" is already part of another project.

The problem is that we are crawling multiple branches, so we will have modules with the same name.
Is there a way to disable this check?

+3


source to share


1 answer


Let's say you have several modules of a Maven project with a bottom structure:

com.company:project
    com.company:project-module1
    com.company:project-module2

      

In your java source code now "com.company:project" has been renamed to "com.company:myProject", so the new java reference source would be:

com.company:myProject
    com.company:project-module1
    com.company:project-module2

      



When you create a new source and submit analysis data to Sonar, it suggests:

[ERROR] Failed to execute target org.sonarsource.scanner.maven: sonar-maven-plugin: 3,2: sonar (default-cli) in myProject: Module "com.company:project-module1" is already part of the project " com.company:project "→ [Help 1]

This error is due to the fact that "com.company:project-module1" has already been executed and registered with Sonar before and now belongs to the "com.company:project" project, which no longer exists in your source code.

Solution: In the Sonar project configuration → Update key, change the project "com.company:project" from "com.company:project" to "com.company:myProject", rebuild Maven and click on Sonar, the problem will be solved.

0


source







All Articles