Sonar-scanner cannot run on windows with gitlab runner

Must-share information (formatted with Markdown):
Sonarqube: 8.4.2 (Developer edition)
Language: C

I am trying to run:
$ sonar-scanner -Dsonar.login= -X

On windows cmd line it works fine and uploads the results.
But On windows powershell and on gitlab windows runner, I get the below error:
ERROR: Unrecognized option: .login=
usage: sonar-scanner [options]
INFO: -D,–define Define property
INFO: -h,–help Display help information
INFO: -v,–version Display version information
INFO: -X,–debug Produce execution debug output

Any idea how to solve this issue?

Hey there.

Can you show how exactly you’re executing the scanner in the context of Powershell/the Gitlab runner? In powershell, are you executing the exact same command as on the windows command line?

I am executing as i said in the message:
$ sonar-scanner -Dsonar.login=xxx -X

I found out the problem. Its the syntax. On powershell I should run as below arguments with double quotes
$ sonar-scanner -D"sonar.login=xxx" -D"" -X

1 Like

Thanks for the update.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.