sonar 安装使用
2019-12-11 本文已影响0人
麦田夕阳
-
配置数据源 打开配置文件:..\sonarqube\conf\sonar.properties
sonar.jdbc.username=root
sonar.jdbc.password=fjh
sonar.jdbc.url=jdbc:mysql://127.0.0.1:3008/sonar?useUnicode=true
&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
-
启动 bin/startSonar.bat
-
http://localhost:9000 账号密码 admin/admin
-
maven 配置setting.xml
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.jdbc.url>jdbc:mysql://127.0.0.1:3008/sonar</sonar.jdbc.url>
<sonar.jdbc.username>root</sonar.jdbc.username>
<sonar.jdbc.password></sonar.jdbc.password>
<sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>
<sonar.host.url>http://localhost:9000</sonar.host.url>
</properties>
</profile>
</profiles> -
找到项目的路径执行,maven插件把代码的检查结果发到sonar
mvn sonar:sonar -
sonar 结果界面
{A7177C15-17E1-4B42-AE4F-F497D50F51F2}_20191211094307.jpg