I am using a bitbucket cloud and using pipeline feature to kickoff a sonar cloud.
Here is what I have completed
- Created a working repo with code already merged into the “master”.
- Created a pipeline (bitbucket-pipelines.yml)
- Configured the project in the sonar cloud, and noted the project token TOKEN_1
- Linked the project to the bitbucket.
- Update bitbucket-pipelines.yml with the following detail
mvn -B clean verify sonar:sonar -Dsonar.host.url=https://sonarcloud.io \ -Dsonar.projectKey=PROJECT-KEY \ -Dsonar.organization=PROJECT-ORG \ -Dsonar.login=TOKEN_1
Project builds and compiles without any problem, however it fails due to -
Project was never analyzed. A regular analysis is required before a branch analysis.
When I checkout the project locally and run the above maven command, it works and I can see the results posted in the sonarcloud.io under the organization.
I am not sure why it fails when it is executed as part of the pipeline. Any thoughts, on what I did wrong?
Thanks in advance.