sonarQube使用maven进行检查
1.在maven的中找到setting配置文件。在setting.xml中增加sonarqube配置。如下:
<profiles> <profile> <id>sonar</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <sonar.jdbc.url>jdbc:mysql://192.168.1.97:3306/sonar?useUnicode=true&characterEncoding=utf8</sonar.jdbc.url> <sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver> <sonar.jdbc.username>root</sonar.jdbc.username> <sonar.jdbc.password>root</sonar.jdbc.password> <sonar.host.url>http://192.168.1.97:9000/</sonar.host.url> </properties> </profile> </profiles>
2.ecplise中使用选择pom.xml文件,点击右击,选择run as ->maven build
3.User settings 选择我们本地maven的setting.xml配置文件。在Goals中输入命令 clean install sonar:sonar,点击running
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步