idea sonar idea集成sonar

idea使用篇

https://www.cnblogs.com/qiaoyeye/p/5249786.html

參考:https://my.oschina.net/milletes/blog/761742

https://blog.soilove.cn/archives/1878.html

   

1. 打開File->Settings->Plugins,搜索sonar插件

2.點擊圖中第二個框起來的選項,在搜索框中輸入sonar,出現一下界面

3.選擇SonarLint,點擊Install安裝

4.安裝完畢,點擊Restart InteliJ IDEA

5.在maven中配置sonar:打開setting.xml配置文件,在其中加入如下代碼:
    

<profile>

      <id>sonar</id>

      <activation>

        <activeByDefault>true</activeByDefault>

      </activation>

      <properties>

        <sonar.jdbc.url>

               jdbc:mysql://localhost: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>521410</sonar.jdbc.password>

        <sonar.host.url>http://localhost:9000</sonar.host.url>

      </properties>

    </profile>

6.然後項目中就如出現如圖所示,就能分析文件中的代碼質量了

參考:http://www.cnblogs.com/qiaoyeye/p/5249786.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章