Can not run the project automatically

I have SonarQube on my localhost and I want to use Scanner to analyze my project.
I create a sonar-project.properties file and then run it using Terminal.
Here is the content of my sonar-project.properties file:

sonar.projectKey=ml4a
sonar.projectName=ml4a
sonar.projectVersion=1.0
sonar.login=#my_username
sonar.password=#my_password
sonar.host.url=http://localhost:9000
sonar.sources=ml4a
sonar.sourceEncoding=UTF-8

Then I run it using sonar-scanner command and here is the result:

Is there a problem using this approach to create and analyze a project?

The interesting part is that when I re-run it only using this command:
sonar-scanner (without specifying any paths) it creates the project and analyze it!
What might be the problem here?

Hey there.

This is exactly what you’re supposed to do – as long as sonar-project.properties exists in the directory from which you run sonar-scanner, it’s used. No specifying paths.