Maven project uses sonar scan

1. Add plugin to pom.xml in the project

<plugin>
   <groupId>org.sonarsource.scanner.maven</groupId>
   <artifactId>sonar-maven-plugin</artifactId>
   <version>3.1.1</version>
</plugin>

Execution maven installinstall the plugin.

2. Execute the maven command

sonar:sonar -Dsonar.jdbc.driver=com.mysql.jdbc.Driver \
-Dsonar.branch.name=master \
-Dsonar.host.username=admin \
-Dsonar.host.password=admin \
-Dsonar.host.url=http://xxx:9000/sonar \
-Dsonar.projectName=sxpush

sonar.host.url Fill in the sonar server address that can be accessed http://xxx:9000.

3. Verification

Open http: // xxx: 9000 / sonar to see the sonar of the project.

Published 420 original articles · 143 thumbs up · 890,000 views

Guess you like

Origin blog.csdn.net/jeikerxiao/article/details/95601040