1.maven的setting.xml中
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- 配置 Sonar Host地址,默认:http://localhost:9000 -->
<sonar.host.url>
http://myserver:9000
</sonar.host.url>
</properties>
</profile>
</profiles>
2.idea配置sonar插件
http://791202.com/2020/02/27/intellij-idea/462/
3.在项目目录下执行:mvn clean compile sonar:sonar
4.在http://myserver:9000中去看结果