Analyzing a Maven project consists of running a Maven goal in the directory where the pom.xml file sits. If possible, an
install goal should be performed prior to the
mvn clean install -DskipTests=true mvn sonar:sonar
skipTests=true not to run unit tests twice: during the
install goal and again during the
sonar:sonar goal. You can also deactivate the integration tests execution. Please refer to the Maven documentation.
Make sure you're not using the eclipse Eclipse plugin maven embedder. Define a new maven Maven runtime pointing to your local maven Maven install, use the latest maven eclipse plugin and uncheck "resolve workspace artifacts" in the maven project launch window.
Note that Advanced Reactor Options (such as "--projects" and "--resume-from") are not supported by Sonar SonarQubeTM and should not be used.
When the above configuration is not possible, you can run an analysis in one command, but unit tests will run twice: once in the
install goal and once in the sonar one. Do not use the DskipTests=true parameter, otherwise Sonar will not execute unit tests and therefore not report on them.