Template for a good bug report, formatted with Markdown:
versions used:
SonarScanner for Azure DevOps 1.8.0
error observed:
##[error]Cannot read property ‘concat’ of undefined
steps to reproduce:
SonarCloudPrepare with ScannerMode set to CLI and no SONAR_SCANNER_OPTS set
potential workaround
set SONAR_SCANNER_OPTS should make it work
Looking at the code, it seems like if the scanner mode is set to CLI, the scanner will try to get the SONAR_SCANNER_OPTS and concat them with other variables, something that will fail when there are no SONAR_SCANNER_OPTS set.
Is there a reason why its done like that? Or is it just a bug?
Thanks for the report. We released new versions of the SonarQube/SonarCloud Extension for Azure Devops about an hour ago, which evidently contains this nasty bug. Since extensions auto-update… well, at least the feedback loop is pretty short. Scanning with the CLI should not fail if SONAR_SCANNER_OPTS isn’t provided.
We can reproduce this on our side and a fix is on the way.
New version of this extension is available, fixing this bug (4.7.1)
Please note that if you intend to add values in the SONAR_SCANNER_OPTS environment variables, please provide them before the prepare analysis task, so that they will be correctly passed to the scanner.
I am able to reproduce the Could not find or load main class error by using a project name with a space included. The workaround… changing the project name to not have a space included.
This issue persists in the fix version released this afternoon. I’ve reported this internally.
Colin