解決eclipse插件openextern無法打開依賴jar包的問題

適用於eclipse4.x.x,本人環境爲eclipse4.2.0

 1、openextern

官網:http://code.google.com/p/openextern/

源代碼:svn checkout http://openextern.googlecode.com/svn/trunk/ openextern-read-only

問題:無法打開maven、jar等外部jar包依賴的問題

2、問題解決

導入eclipse中,進行調試;發現能夠獲取路徑;在BaseOpenAction.java中,發現方法public String getSelectedFolderPath(ISelection selection)的ISelection已經獲取到路徑,但不屬於判斷的資源類型,返回爲空。 所以只需要做如下處理即可。

  1. /** 
  2.              * dependency jar folder 
  3.              */ 
  4.             String fullname = sel.toString(); 
  5.             int firstIndexOfBlank = fullname.indexOf(" "); 
  6.             String fullJarPath = fullname.substring(0, firstIndexOfBlank); 
  7.             if(!"".equals(fullJarPath)){ 
  8.                 return fullJarPath; 
  9.             } 

3、打包發佈

在eclipse中開發plugin時,可以藉助eclipse ide生成build.xml,再執行ant build.update.jar即可。

關於eclipse中plugin的生成發佈,參考:http://tianya23.blog.51cto.com/1081650/611994

 

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