Alex Rivera | Logout

Eclipse: how to keep project source files and ant build.xml seperate from eclipse workspace?

Asked 2011-03-18T22:21:11.357
9

I'm trying to re-familiarize my self with the Eclipse environment and ant integration.

Question is: how to keep my sources dir + build.xml separate from the workspace?

What I have is a small java project and its build.xml file with all the sources placed under a separate project folder. I then started Eclipse and let it import my project via New Project -> "Java Project from existing Ant Build File"

All went fine, until when I wanted to build the project from inside Eclipse using build.xml. Ant starts complaining about not being able to find the source tree. After I examined the workspace I found that Eclipse had copied the build.xml into the workspace, so it's obvious that ant couldn't find any sources there. They are still under my project director and I do want to keep them there, if possible.

so whats the best way so make this setup work? workspace on one side, my project on the other?

Thank!

edit: Is what I want even possible ?

Edit
Report

1 Answer

0

There isn't really any need to try and avoid Ant and Eclipse using the same set of source files. In fact, its probably better that they do use the same set.

Bear in mind, you're not actually mixing anything. There is just one set of source files and then there are two different ways of building it; Ant and Eclipse. These builders are independent of each other, so there is no problem with being coupled to Eclipse. You can even happily commit all the eclipse files (.classpath, .project, .settings) to source control without affecting any developers who use a different IDE.

answered 2011-03-19T09:07:32.773

Your Answer