How Do You Troubleshoot the sonar-scanner CLI Not Working?

Problem scenario
You run sonar-scanner from the command prompt, but you receive an error. The error looks like one of the following:

"Task '-x' does not exist. Please use 'list' task to see all available tasks"

"You must define the folowing mandatory properties for 'Unknown': sonar.projectKey, sonar.sources"

What should you do to get sonar-scanner to work?

Solution
Run the sonar-scanner command from a local directory where you have sonar-project.properties.

Leave a comment

Your email address will not be published. Required fields are marked *