1. 你先下载一个SVN 包 名字是 site-1.6.2.1.zip 在百度搜一下就有

2. 写一段java代码
建立一个java工程 然后在里面写一个类,类名是CreatePluginsConfig,包的名字我自己随便起得 叫dd

代码如下:

package dd;

import java.io.File;   
import java.util.ArrayList;   
import java.util.List;   

/** 
* MyEclipse 7.0G安装插件代码生成器 
* @author Administrator 
* 
*/ 
public class CreatePluginsConfig {   
    private String path;   

    public CreatePluginsConfig(String path) {   
        this.path = path;   
    }   

    @SuppressWarnings("unchecked")
public void print() {   
        List 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) {   
                    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;   
                }   
                String[] filenames = fileName.split("_");   
                String filename1 = filenames[0];   
                String filename2 = filenames[1].substring(0, filenames[1]   
                        .lastIndexOf("."));   
                result = filename1 + "," + filename2 + ",file:/" + path + "\\" 
                        + fileName + ",4,false";   
                System.out.println(result);   
            }   

        }   
    }   

    public List getFileList(String path) {   
        path = getFormatPath(path);   
        path = path + "/";   
        File filePath = new File(path);   
        if (!filePath.isDirectory()) {   
            return null;   
        }   
        String[] filelist = filePath.list();   
        List filelistFilter = new ArrayList();   

        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) {   
                System.out.println("===========jad==========");   
        new CreatePluginsConfig(   
        "D:\\Program Files\\Genuitec\\MyEclipse 7.0\\subversion\\plugins")   
        .print(); //插件路径   

    }   
} 

 

其中D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins 是我的SVN的解压路径 最好放在myeclipse 的目录下 一边编译的时候容易找到, 运行项目 最后看到 如下的输出:

com.collabnet.subversion.merge,1.9.0.4,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\com.collabnet.subversion.merge_1.9.0.4.jar,4,false
com.sun.jna,3.0.9,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\com.sun.jna_3.0.9.jar,4,false
org.tigris.subversion.clientadapter.javahl.win32,1.6.3,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\org.tigris.subversion.clientadapter.javahl.win32_1.6.3.jar,4,false
org.tigris.subversion.clientadapter.javahl,1.6.3,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\org.tigris.subversion.clientadapter.javahl_1.6.3.jar,4,false
org.tigris.subversion.clientadapter.svnkit,1.6.2,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\org.tigris.subversion.clientadapter.svnkit_1.6.2.jar,4,false
org.tigris.subversion.clientadapter,1.6.0.2,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\org.tigris.subversion.clientadapter_1.6.0.2.jar,4,false
org.tigris.subversion.subclipse.core,1.6.2,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\org.tigris.subversion.subclipse.core_1.6.2.jar,4,false
org.tigris.subversion.subclipse.doc,1.3.0,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\org.tigris.subversion.subclipse.doc_1.3.0.jar,4,false
org.tigris.subversion.subclipse.graph,1.0.7,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\org.tigris.subversion.subclipse.graph_1.0.7.jar,4,false
org.tigris.subversion.subclipse.mylyn,3.0.0,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\org.tigris.subversion.subclipse.mylyn_3.0.0.jar,4,false
org.tigris.subversion.subclipse.ui,1.6.2,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\org.tigris.subversion.subclipse.ui_1.6.2.jar,4,false
org.tmatesoft.svnkit,1.3.0.5847,file:/D:\Program Files\Genuitec\MyEclipse 7.0\subversion\plugins\org.tmatesoft.svnkit_1.3.0.5847.jar,4,false

 

把上面的代码拷贝到myeclipse 下的 configuration\org.eclipse.equinox.simpleconfigurator\bundles.info文件尾部即可。此时关闭 myeclipse . 然后以-cleanup 的方式运行myeclipse 你就会发现 SVN神奇的加载成功了   查看方法:windows -----showviews---others 出现SVN 选项。。

到此为止。。有同样的问题的开发者 欢迎来跟我交流。。


发布评论
IT源码网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!

重启myeclipse server栏里tomcat 图标消失的问题讲解
你是第一个吃螃蟹的人
发表评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。