java后端集群化专题

持续集成2-SonarQube

2018-02-02  本文已影响11人  江江的大猪

sonar是一个代码质量管理平台,根据规则对代码进行静态检查,对保证工程的代码质量很有帮助

innodb_buffer_pool_size=256M //作为自己学习用够了
query_cache_type=1 //默认为0关闭query_cache功能
query_cache_size=32M //设为32M

因为sonar进行代码检测的时候会一瞬间对数据库大量操作,所以需要优化一下数据库的配置

sonar.jdbc.username=root
sonar.jdbc.password=root
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
# sonar.web.host=0.0.0.0 #默认就是全网都可以访问
# sonar.web.context= #默认为根目录,使用浏览器访问
# sonar.web.port=9000 #默认为9000端口,-1为禁用
# sonar.web.https.port=-1 #默认禁用https

最好是在mysql里单独建一个用户和库,我这里学习使用就没创建单独的用户,库要用utf8(utf8mb4),最好单独建个库,因为会创建很多表。

<profile>
    <id>sonar</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <!-- Example for MySQL-->
        <sonar.jdbc.url>jdbc:mysql://127.0.0.1:3306/sonar?useUnicode=true&amp;characterEncoding=utf8</sonar.jdbc.url>
        <sonar.jdbc.username>root</sonar.jdbc.username>
        <sonar.jdbc.password>root</sonar.jdbc.password>
        <!-- Optional URL to server. Default value is http://localhost:9000 -->
        <sonar.host.url>http://127.0.0.1:9000</sonar.host.url>
    </properties>
</profile>
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>sonar-maven-plugin</artifactId>
    <version>2.6</version>
</plugin>
上一篇 下一篇

猜你喜欢

热点阅读