当svn有多个子项目且没有根项目的时候,用eclipse拷贝下来是容易出问题的,经常子项目之间的依赖会有问题,还是推荐用IDEA。
操作说明:
如果SVN有 A,B,C,D四个项目,A为web项目,B为给客户端的接口应用,C为公共应用,D为DAO应用
A,B,C,D都是以zt开头的命名
先在IDEA的项目目录新建A,B,C,D四个项目名目录,再新建一个zt-integration文件夹再在zt-integration文件夹下建一个build.gradle文件,里面不写内容,再建一个settings.gradle文件,里面内容为:
boolean buildAll = System.getProperty('all', '1') == '1'
if (buildAll) {
String[] upDirs = new File('../').list(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.startsWith("zt") && !name.endsWith('integration');
}
});
println "包含子工程:$upDirs"
includeFlat upDirs
}
然后再在每个目录下check out对应的项目代码。
打开IDEA,然后File-->new-->project from existing Source 把zt-integration导入进来,就会把子项目加进来
各个子项目的依赖用 compile project(':其他子项目名')