Reputation: 389
Is there a way to have multiple views of the same java project which is being built by go-server in seperate pipelines with each pipeline building different git branch.
go-job : mvn sonar:sonar -Dsonar.host.url=http://localhost:9000
Each pipeline once successfully built overwrites previous view since the maven project is same. Wondering if I can differentiate sonar project using branch identifier or via other command parameter so that overwrite doesnt happen.
Upvotes: 1
Views: 2020
Reputation: 918
I have encountered same issue and found solution, hope this will help someone. Whatever project key is generated while login (token generated), you can get the same token and build your project like below. I assume that you are able to view sonar dashboard. Assume you have 3 projects
Build your A project as
Build your B project as
and similarly build third one as well. Here what exactly is happening, -Dsonar.projectKey will take the project and it will post the generated report for given project to the token provided for localhost:9000 url. So how many projects you have it will show the reports for all in the sonar dashboard.
please try this and if this works then hit the like button :)
Upvotes: 0
Reputation: 994
To analyze multiple instances of the same project, you can use the sonar.projectKey
property to differentiate the project.
Example: mvn sonar:sonar -Dsonar.projectKey=my-first-project-key
Upvotes: 1