java進階(四)------java編程規範---代碼品質偵查工具FindBugs、PMD和CheckStyle的安裝

來源:互聯網
上載者:User

java進階(四)------java編程規範---代碼品質偵查工具FindBugs、PMD和CheckStyle的安裝

 

這裡使用外掛程式的方式 對myeclipse進行FindBugs、PMD和CheckStyle的安裝。

 

 

分別搜尋 checkstyle、pmd、findbugs就能找到它們對應的外掛程式。

 

 

 

對於外掛程式的安裝,有三種安裝方法。 我分別用不同的方法安裝checkstyle、pmd、findbugs。

以此類推,三個外掛程式都可以用同一種方法安裝。推薦 dropins自動安裝。

但是 版本需要注意。

否則會出現安裝成功後重啟myeclipse找不到相關菜單,在show view中找不到介面。

例如Findbugs 3.0.0需要Jdk1.7或者之後的Jdk版本才能運行。

與myeclipse的版本可能也有關。

所以建議 不要安裝太新的版本。

 

我的 myeclipse 10 成功安裝 checkstyle 6.1.1 ,PMD 3.2.6,findbugs 2.0.0 。

 

 

 

圖形介面安裝-checkstyle

 

下載:net.sf.eclipsecs-updatesite_5.7.0.201402131929-bin.zip檔案

 

 

然後使用myeclipse的圖形按鈕安裝,步驟點選連結:

myeclipse安裝checkstyle外掛程式

 

使用時可參考

checkstyle常見錯誤

 

 

 

手動設定安裝-PMD

 

 

下載PMD我用的是pmd-eclipse-3.2.6

 

解壓net.sourceforge.pmd.eclipse-3.2.6.v200903300643.zip得到檔案夾eclipse,將eclipse檔案夾下的features和plugins拷貝到myeclipse下的Common目錄下,確認替換合并。

 

 

之後到MyEclipse安裝目錄下開啟/MyEclipse 10/configuration/org.eclipse.equinox.simpleconfigurator/bundlers.info

 

在最後面加上 net.sourceforge.pmd.eclipse.plugin,3.2.6.v200903300643,../Common/plugins/net.sourceforge.pmd.eclipse.plugin_3.2.6.v200903300643.jar,4,false

 

這一步是關鍵。如果下載其它版本,構造的名稱需要跟自己的檔案對應,格式需要與bundles.info中的其它登入好的格式 對應。

 

 

 

重啟MyEclipse後項目右擊就能看到pmd了

 

 

 

 

 

 

dropins自動安裝-FindBugs

 

下載edu.umd.cs.findbugs.plugin.eclipse_2.0.0.20111220.zip

解壓縮後將edu.umd.cs.findbugs.plugin.eclipse_2.0.0.20111220檔案夾放到MyEclipse的dropins檔案夾中

D:myeclipseMyEclipse 10dropins

重啟MyEclipse後,項目右擊就能看到FindBugs的選項了,show view中也有相對應的介面

 

 

 

 

 


 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.