- Myeclipse 安装svn 插件,这个是我个人认为是最快得方法。
1).在Myeclipse的安装目录MyEclipse下新建一个svn的目录.
2).下载一个svn的插件sit 解压,把里面的plugins、features两个文件拷到新建的svn文件下。
3).在Myeclipse里运行下面的代码:
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* MyEclipse10
*/
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)
{ //这是新建的svn 路径
String plugin = "D:\\Program Files\\MyEclipse\\svn";
new PluginConfigCreator().print(plugin);
}
}
修改main方法中的路径,运行后把控制台打印的东西拷贝到 MyEclipse\MyEclipse10\configuration\org.eclipse.equinox.simpleconfigurator下面的文件bundles.info里面
拷贝时 最好和文件中之前有的代码用空行隔开。
4).重启Myeclipse,就可以了。
这是svn的两个版本的插件 http://pan.baidu.com/s/1bnszQCB