Importing eclipse projects using Ant
I currently use an Ant s开发者_运维知识库cript to download several Java projects (projects divided as modules) from a svn repository and generate a single war file. But now there is a need to use those scripts to download these projects directly to an eclipse workspace.
Even after the build.xml is executed successfully, these projects aren't really imported by eclipse. The projects are fully stored in svn (with their .project, .classpath, etc..) Probably something is missing on .metadata folders and files on workspace root, i don't know.
Does someone know how import eclipse projects to an active workspace using command line or even through an ant plugin?
Thanks in advance
Have you considered using an eclipse team project set to import all of the projects? I know this isn't exactly what you are asking for, and I understand that you may have a strong reason to use the ant script you have, but I think creating a project set fits your needs pretty well.
It sounds like you've got all the files you need for the projects (.classpath, .project, etc.), so you can get eclipse to see the projects by selecting File -> Import -> Existing Projects into Workspace and browse to the workspace folder. You should see a list of the projects that your script retrieved from SVN. If so, make sure the "Copy projects into workspace" option is disabled and click Finish.
I think your initial thought that something in the .metadata folder was not in SVN is correct. You should be careful about what you put in SVN from the .metadata folder though. Although I don't know exactly which files you might want to try sharing, you might want to investigate the files in .metadata/.plugins/org.eclipse.core.resources.
精彩评论