適用於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已經獲取到路徑,但不屬於判斷的資源類型,返回爲空。 所以只需要做如下處理即可。
- /**
- * dependency jar folder
- */
- String fullname = sel.toString();
- int firstIndexOfBlank = fullname.indexOf(" ");
- String fullJarPath = fullname.substring(0, firstIndexOfBlank);
- if(!"".equals(fullJarPath)){
- return fullJarPath;
- }
3、打包發佈
在eclipse中開發plugin時,可以藉助eclipse ide生成build.xml,再執行ant build.update.jar即可。
關於eclipse中plugin的生成發佈,參考:http://tianya23.blog.51cto.com/1081650/611994