views:

247

answers:

2

Hello there,

I currently use an Ant script 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

+1  A: 

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.

ChrisH
It is because different people may be using different svn versions from the same project (on a same branch).
Danmaxis
That sounds fragile, but it does prevent use of project sets.
ChrisH
Yeah... but orders are orders. We may have to review our versioning methods again here...On a near future, I'll consider using project sets.
Danmaxis
+1  A: 

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.

ChrisH
After these procedures, it works as expected. Thanks a lot
Danmaxis