We are trying to integrate Sonarcloud scan for every pull request created in Bitbucket repository. We have used ‘Bitbucket pull request builder’ as a part of this process and eventually landed up with a result.
The parameters of ‘Execute sonarqube scannner’ in Jenkins is something similar to :
sonar.host.url=https://sonarcloud.io
sonar.organization=****
sonar.projectName=*****
sonar.projectVersion=1.0
sonar.projectKey=****
sonar.pullrequest.branch=master
sonar.sources=A/B/test.java,A/C/test1.java,A/D/test2.java
sonar.java.binaries=***
sonar.exclusions=
sonar.pullrequest.key=5
Whenever we are creating a Pull request in A/B/* or A/C/* folders, the sonarcloud scan is occurring for that PR without any errors. But when we create a pull request in master by creating a new folder and a file (Ex: A/E/x.java) , the sonarcloud scan is failing saying that:
ERROR: Error during SonarQube Scanner execution
ERROR: The folder ‘A/E/’ does not exist for ‘***’
Which means that the folder A/E is not there in the existing workspace in Jenkins… How can i even scan the newly created folders in the PR ? Any suggestions would be helpful
Thank you,