前言
通过Maven调用SonarQube进行代码检测
修改Maven配置
<sonar.login></sonar.login>
:指定登陆SonarQube的用户名
<sonar.password></sonar.password>
:指定登陆SonarQube的用户名
<sonar.host.url></sonar.host.url>
:指定SonarQube服务的URL
maven/conf/setting.xml1 2 3 4 5 6 7 8 9 10 11 12 13
| <profiles> <profile> <id>sonar</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <sonar.login></sonar.login> <sonar.password></sonar.password> <sonar.host.url>http://127.0.0.1:9000</sonar.host.url> </properties> </profile> </profiles>
|
进行代码检测
project
:项目根目录
1 2
| cd project mvn sonar:sonar
|
完成
参考文献
哔哩哔哩——云原生技术架构