2

【笔记】通过 Maven 调用 SonarQube 进行代码检测

 1 year ago
source link: https://loli.fj.cn/2023/07/26/%E9%80%9A%E8%BF%87Maven%E8%B0%83%E7%94%A8SonarQube%E8%BF%9B%E8%A1%8C%E4%BB%A3%E7%A0%81%E6%A3%80%E6%B5%8B/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

通过 Maven 调用 SonarQube 进行代码检测

修改 Maven 配置

<sonar.login></sonar.login>:指定登陆 SonarQube 的用户名
<sonar.password></sonar.password>:指定登陆 SonarQube 的用户名
<sonar.host.url></sonar.host.url>:指定 SonarQube 服务的 URL

maven/conf/setting.xml

<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:项目根目录

cd project
mvn sonar:sonar

哔哩哔哩 —— 云原生技术架构


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK