We currently have multiple feature releases in perforce. Each of these branches has POM files that contain a version tag and name tag that is tied to that branch.
When we run sonar:sonar each branch scan overwrites another branch scan and you only see one at a time in the sonar gui.
Can a sonar project be tied to maven GroupId>ArtifactId>Version or even instead of just being Tied to the GroupId.
FYI, GroupId and ArtifactId do not change when we branch the POM.
You can set a branch to Keep when inactive at the project level from from the Branches tab at Project Settings > Branches and Pull Requests.
On your project, go to Administration / Branches & Pull Requests. There, you will see in the top-right corner a text like this: "Long living branches pattern: (branch|release)-. * ". That means that when the name of the branch starts with branch- or release- , then it will be considered a long-living branch.
Before we could integrate our Maven project to SonarQube, We will need to integrate SonarQube Scanner in our POM. XML. SonarQube Scanner is recommended since it is the default launcher to analyze a project with SonarQube. // You can also replace the IP with your own IP or just say localhost instead.
What happens when you run mvn sonar:sonar is that an analysis report is generated and submitted to the server for asynchronous processing. Once the report is successfully submitted to the server, the local process ends.
I found your question while searching for a similar topic, and I noticed you had not received an answer. If you pass the -Dsonar.branch, each branch will be treated as a different project. As documented here:
http://sonarqube.15.x6.nabble.com/Sonar-Analysis-for-Feature-Branches-td5004642.html#a5004647
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With