在IDEA中使用sonarqube - sysrj2010/CICD GitHub Wiki
一、安装SonarLint插件:
1、打开File->Settings->Plugins,搜索sonar插件
2、选择SonarLint,点击Install安装
二、配置Maven的sonar配置
1、在项目中右键选择maven->setting (修改,如果没有直接新建)
2、在新建的setting文件中加入如下代码:
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.jdbc.url>jdbc:postgresql://localhost:5432/postgres</sonar.jdbc.url>
<sonar.jdbc.driver>org.postgresql.Driver</sonar.jdbc.driver>
<sonar.jdbc.username>postgres</sonar.jdbc.username>
<sonar.jdbc.password>postgres</sonar.jdbc.password>
<sonar.host.url>http://localhost:9000</sonar.host.url>
</properties>
</profile>
三、查看sonar代码分析 1、打开左下方的sonarline窗口,查看各项分析指标