MojoExecutionException: NullPointerExeception while trying to run mvn sonar:sonar

sonarqube
maven

(Brandon Bhagwandeen) #1

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

I’ve downloaded the latest version of SonarQube (7.6), Maven (3.6.0), Java (8 update 201) and the sonar-scanning-examples.

I set up a project on the host and used the command generating by the host:

sonar-scanner
-Dsonar.projectKey=sample-java
-Dsonar.sources=.
-Dsonar.host.url=http://localhost:9000
-Dsonar.login=cec340b9c231a1991230766bd322fcf7403e7b57

also added the proxy.

This is the log sonarlog.txt (44.8 KB)

Here is what I added to the maven’s settings.xml file:

org.sonarsource.scanner.maven sonar true http://localhost:9000

This is the first time i’m using sonarqube and maven. So maybe I didn’t set up the pom files or settings.xml properly but i assumed the examples would work out-of-the-box.