binarylegit
binarylegit

Reputation: 379

Latest Analysis in SonarQube 5.5 removes other projects

I have two gradle projects with different names which run sonar analysis. They both build and will successfully show analysis in SonarQube. The problem though is that when Project A builds it's analysis shows in SonarQube, but then when I run Project B then Sonar ONLY shows Project B and the analysis that was previously visible for Project A is gone from Sonar.

How do I get both projects analysis to exist in SonarQube simultaneously?

Upvotes: 0

Views: 58

Answers (1)

binarylegit
binarylegit

Reputation: 379

As G. Ann pointed out below (thank you). The projects were replacing each other and you have give each project a unique project key.

So in the build.gradle for project A I added:

sonarqube {
  properties {
    property "sonar.projectKey", "projectA"
  }
}

So in the build.gradle for project B I added:

sonarqube {
  properties {
    property "sonar.projectKey", "projectB"
  }
}

That distinguishes the projects in Sonar and now I am seeing both project simultaneously.

Upvotes: 1

Related Questions