博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
myeclipse中安装svn插件
阅读量:4633 次
发布时间:2019-06-09

本文共 4572 字,大约阅读时间需要 15 分钟。

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

 

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

 

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

 

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

[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. publicclass PluginConfigCreator 
  11.     public PluginConfigCreator() 
  12.     { 
  13.     } 
  14.     publicvoid 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.             } elseif (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.             returnnull
  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.     publicstaticvoid main(String[] args) 
  91.     { 
  92.         /*你的插件的安装目录*/ 
  93.             String plugin = "改成安装目录//Genuitec//svn"
  94.         new PluginConfigCreator().print(plugin); 
  95.     } 

package app; import java.io.File; import java.util.ArrayList; import java.util.List; /** * MyEclipse9 插件配置代码生成器 * * */ public class PluginConfigCreator { public PluginConfigCreator() { } public void print(String path) { List<String> list = getFileList(path); if (list == null) { return; } int length = list.size(); for (int i = 0; i < length; i++) { String result = ""; String thePath = getFormatPath(getString(list.get(i))); File file = new File(thePath); if (file.isDirectory()) { String fileName = file.getName(); if (fileName.indexOf("_") < 0) { print(thePath); continue; } String[] filenames = fileName.split("_"); String filename1 = filenames[0]; String filename2 = filenames[1]; result = filename1 + "," + filename2 + ",file:/" + path + "/" + fileName + "//,4,false"; System.out.println(result); } else if (file.isFile()) { String fileName = file.getName(); if (fileName.indexOf("_") < 0) { continue; } int last = fileName.lastIndexOf("_");// 最后一个下划线的位置 String filename1 = fileName.substring(0, last); String filename2 = fileName.substring(last + 1, fileName .length() - 4); result = filename1 + "," + filename2 + ",file:/" + path + "/" + fileName + ",4,false"; System.out.println(result); } } } public List<String> getFileList(String path) { path = getFormatPath(path); path = path + "/"; File filePath = new File(path); if (!filePath.isDirectory()) { return null; } String[] filelist = filePath.list(); List<String> filelistFilter = new ArrayList<String>(); for (int i = 0; i < filelist.length; i++) { String tempfilename = getFormatPath(path + filelist[i]); filelistFilter.add(tempfilename); } return filelistFilter; } public String getString(Object object) { if (object == null) { return ""; } return String.valueOf(object); } public String getFormatPath(String path) { path = path.replaceAll("", "/"); path = path.replaceAll("//", "/"); return path; } public static void main(String[] args) { /*你的插件的安装目录*/ String plugin = "改成安装目录//Genuitec//svn"; new PluginConfigCreator().print(plugin); } }

 

 

这里需要注意的是修改成为刚才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

转载于:https://www.cnblogs.com/zhangdp/archive/2012/08/30/2663259.html

你可能感兴趣的文章
location.origin兼容IE
查看>>
[BZOJ1602] [Usaco2008 Oct] 牧场行走 (LCA)
查看>>
中间件笔记
查看>>
[SDOI2009]晨跑
查看>>
oracleHelper 操作帮助类
查看>>
TPS与QPS
查看>>
使用java中replaceAll方法替换字符串中的反斜杠
查看>>
如何释放电脑被限制的20%网速?
查看>>
Android初学第36天
查看>>
RabbitMQ队列监控
查看>>
Some configure
查看>>
.net core 中的[FromBody]
查看>>
java学习之成员内部类
查看>>
json_encode时中文编码转正常状态
查看>>
流量调整和限流技术 【转载】
查看>>
Android WebView使用与JavaScript使用
查看>>
Axure 全局辅助线(转)
查看>>
图论之tarjan缩点
查看>>
C# 的快捷键汇总(一)
查看>>
正由另一进程使用,因此该进程无法访问此文件。
查看>>