myeclipse9.0安装svn插件(此种方法可以安装任意插件)

此方法适用于所有版本的myeclipse9.0(M1或者官方下载版)

测试环境:

操作系统:CentOS 5.5 X64  win7-32位

JDK      : JDK1.6_17_X64

 

1、下载最新的SVN包(我下的是1.0.6版):

http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240

2、在你的磁盘上任意位置创建文件夹:“myplugins/svn”。名字可以任取,为了方便插件管理,建议名称为“myplugins”。

3、将解压的svn里的两个文件夹拷贝到“myplugins/svn”下。

4、复制下列java代码,修改路径并执行:

 

 

  1. package app; 
  2. import java.io.File; 
  3. import java.util.ArrayList; 
  4. import java.util.List; 
  5. /**
  6. * MyEclipse9 插件配置代码生成器
  7. *
  8. *
  9. */ 
  10. public class PluginConfigCreator 
  11.     public PluginConfigCreator() 
  12.     { 
  13.     } 
  14.     public void print(String path) 
  15.     { 
  16.         List<String> list = getFileList(path); 
  17.         if (list == null
  18.         { 
  19.             return
  20.         } 
  21.         int length = list.size(); 
  22.         for (int i =0; i < length; i++) 
  23.         { 
  24.             String result = ""
  25.             String thePath = getFormatPath(getString(list.get(i))); 
  26.             File file = new File(thePath); 
  27.             if (file.isDirectory()) 
  28.             { 
  29.                 String fileName = file.getName(); 
  30.                 if (fileName.indexOf("_") <0
  31.                 { 
  32.                     print(thePath); 
  33.                     continue
  34.                 } 
  35.                 String[] filenames = fileName.split("_"); 
  36.                 String filename1 = filenames[0]; 
  37.                 String filename2 = filenames[1]; 
  38.                 result = filename1 + "," + filename2 +",file:/" + path + "/" 
  39.                         + fileName + "//,4,false"
  40.                 System.out.println(result); 
  41.             } else if (file.isFile()) 
  42.             { 
  43.                 String fileName = file.getName(); 
  44.                 if (fileName.indexOf("_") <0
  45.                 { 
  46.                     continue
  47.                 } 
  48.                 int last = fileName.lastIndexOf("_");// 最后一个下划线的位置 
  49.                 String filename1 = fileName.substring(0, last); 
  50.                 String filename2 = fileName.substring(last +1, fileName 
  51.                         .length() - 4); 
  52.                 result = filename1 + "," + filename2 +",file:/" + path + "/" 
  53.                         + fileName + ",4,false"
  54.                 System.out.println(result); 
  55.             } 
  56.         } 
  57.     } 
  58.     public List<String> getFileList(String path) 
  59.     { 
  60.         path = getFormatPath(path); 
  61.         path = path + "/"
  62.         File filePath = new File(path); 
  63.         if (!filePath.isDirectory()) 
  64.         { 
  65.             return null
  66.         } 
  67.         String[] filelist = filePath.list(); 
  68.         List<String> filelistFilter = new ArrayList<String>(); 
  69.         for (int i =0; i < filelist.length; i++) 
  70.         { 
  71.             String tempfilename = getFormatPath(path + filelist[i]); 
  72.             filelistFilter.add(tempfilename); 
  73.         } 
  74.         return filelistFilter; 
  75.     } 
  76.     public String getString(Object object) 
  77.     { 
  78.         if (object == null
  79.         { 
  80.             return ""
  81.         } 
  82.         return String.valueOf(object); 
  83.     } 
  84.     public String getFormatPath(String path) 
  85.     { 
  86.         path = path.replaceAll("","/"); 
  87.         path = path.replaceAll("//", "/"); 
  88.         return path; 
  89.     } 
  90.     public staticvoid main(String[] args) 
  91.     { 
  92.         /*你的插件的安装目录*/ 
  93.             String plugin = "改成安装目录//Genuitec//svn"
  94.         new PluginConfigCreator().print(plugin); 
  95.     } 

这里需要注意的是修改成为刚才svn所在路径,建议改为绝对路径。比如我的svn在“/opt/soft/Genuitec/myplugins/svn/”,那么就这样:String  plugin = "/opt/soft/Genuitec/myplugins/svn/";

用windows的朋友只需要设置你们的绝对路径就可以了,比如d:/myplugins/svn/。。。

5、找到“$myeclipse_home/configuration/org.eclipse.equinox.simpleconfigurator/”,打开其中的“bundles.inf”文件,为了防止分不清是不是我们自己后加的东西,在最后面多回几次车,然后粘贴第4步运行后的代码,保存

6、重启myeclipse

7、import工程,看看最下面是不是多了一个“other”文件夹?没错,就是他了,我们的svn终于回来了!

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值