maven依赖
<dependency> <groupId>org.codehaus.sonar</groupId> <artifactId>sonar-maven-plugin</artifactId> <version>5.1</version> </dependency>
setting.xml
<profiles> <profile> <id>sonar</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <sonar.jdbc.url>jdbc:mysql://127.0.0.1:3306/sonar?useUnicode=true&characterEncoding=utf8</sonar.jdbc.url> <sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver> <sonar.jdbc.username>root</sonar.jdbc.username> <sonar.jdbc.password>123456</sonar.jdbc.password> <sonar.host.url>http://127.0.0.1:9000/</sonar.host.url> </properties> </profile> </profiles>
命令:
clean install sonar:sonar