ishwari
(ishwari)
September 14, 2021, 2:56pm
1
We are using below command to enable maven Sonar scan
"mvn -Dsonar.projectName=ProPR-Project -Dsonar.projectKey=“ProPR-Project-${Revision_Number}” --file parent/pom.xml sonar:sonar "
We have same project name but Project key changes as per revision number.
Issue here is 1) Even though project name is same, Every time new Project is created in SonarQube
2) If we keep same static project key then mvn is unable to scan.
Need some command to have scan reports appended in same project
Please help
felipebz
(Felipe Zorzo)
September 14, 2021, 3:00pm
2
Hi.
ishwari:
Even though project name is same, Every time new Project is created in SonarQube
The sonar.projectName property is just a description. SonarQube is creating new projects because your using a different sonar.projectKey each time.
ishwari:
If we keep same static project key then mvn is unable to scan.
What’s the exception message?
ishwari
(ishwari)
September 15, 2021, 6:03am
3
Hello,
Thank you for the quick response.
Currently I am using
mvn -Dsonar.projectName=ProPR-Project -Dsonar.projectKey=“ProPR-Project-${Revision_Number}” --file parent/pom.xml sonar:sonar
This everytime creates a new Project named - “ProPR-Project” with new key .
Also if we use
mvn -Dsonar.projectName=ProPR-Project -Dsonar.projectKey=“ProPR-Project” --file parent/pom.xml sonar:sonar
Sonar run fails.
We need command such that…
Only one project “ProPR-Project” must be created. In that same project further scan report must be added.