理由:因新搭建了一个项目,完成之后需要检测代码进行评优。
过程:
1、环境配置: IDEA 2019 + Maven3.3.9 + sonarqube7.7 + JDK1.8 + MySQL5.7
2、参考链接:
>>> https://blog.csdn.net/weixin_40861707/article/details/82117232 >>>https://blog.csdn.net/wojiushiwo945you/article/details/100699885https://blog.csdn.net/wojiushiwo945you/article/details/100699885
两个结合一起查看,信息已经很全了。
3、配置过程:
sonar.propertis文件
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false sonar.jdbc.username=root sonar.jdbc.password=root sonar.sorceEncoding=UTF-8
maven setting.xml文件
<profile> <id>sonar</id> <properties> <sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar</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://localhost:9000</sonar.host.url> </properties> </profile> <activeProfiles> <activeProfile>sonar</activeProfile> </activeProfiles>