Maven project failing

Using: SonarQube 9.9 LTS version
When I use the maven command with sonar this is the error I am getting.
Command: ./mvnw \ org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ \ \ -Dsonar.login=xxx \ -Dsonar.projectKey=xxx \ -Dsonar.projectName="xxx"


Error: Unknown lifecycle phase " ". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. → [Help 1]

Can you please help?


That long form of the command (org.sonarsource...) is only useful/needed when you’re trying to pin to a specific version of the analyzer. As written - without a version string - it’s incorrect. Have you tried, per the docs, a simple mvn sonar:sonar?