Migrating to Eclipse from Ant [message #509491] |
Fri, 22 January 2010 10:26  |
Eclipse User |
|
|
|
[originally posted in 'Newcomers', but reposted here where it probably belongs]
I am an experienced Java developer. I am interested in moving some Ant-based web app projects to Eclipse. I have zero experience with Eclipse, although I did manage to fight back the tears of boredom and watch a couple dozen of the Flash tutorials
I'm sure there is a good page somewhere explaining how to migrate from Ant to Eclipse, but I haven't been able to find any. The tutorials I'm finding all seem to assume one is starting a new project from scratch. I have thousands of class files, resources, etc., with build.xml files that have evolved over the years, so these simplistic examples don't help me much. Is it possible/advisable to stick with my existing build.xml?
Any advice, pointers, or links would be greatly appreciated. Thanks.
|
|
|
Re: Migrating to Eclipse from Ant [message #509526 is a reply to message #509491] |
Fri, 22 January 2010 12:04   |
Eclipse User |
|
|
|
I'm not sure if a single document exists explaining everything needed
for such migration, because Ant build files can do just about anything,
right?
So, depending on the specific targets in your build.xml, some tasks
may just work automagically, some can be done in similar ways and
for some your existing build.xml might be the best choice.
E.g.:
- managing dependencies and invoking the compiler should
probably better leverage the JDT (configurable mostly via the
Java Build Path - perhaps after defining some Classpath Variables).
At least you want to use incremental compilation, wouldn't you?
- copying resources may happen automatically, if resources
are placed in source folders.
- for creating jars you _might_ want to migrate to a .jardesc
configuration which is created by the Export ... Archive File wizard.
Etc.
If you need more specific answers, you might want to briefly state,
what kind of tasks you use Ant for.
Note, most of the commands and configuration pages can be found
by pressing Ctrl-3 and just typing a name ...
HTH,
Stephan
|
|
|
Re: Migrating to Eclipse from Ant [message #509563 is a reply to message #509526] |
Fri, 22 January 2010 17:49   |
Eclipse User |
|
|
|
What I had been hoping to find was a blog post or two saying "Well, this is how we did it.", to give me some ideas about what works and what doesn't work.
Instead, I can't find any mention at all of moving an existing project (Ant-based or otherwise) into Eclipse.
I don't know whether or how the existing directory structure may need to be changed. I don't know whether to use the New Project -> SVN -> Checkout Projects from SVN Wizard (and if so, how to specify the existing repository location - a typed URL simply doesn't 'take'). I don't know whether to start with the existing build.xml file and migrate away from it, or start from scratch and import needed functionality. Of course, I really don't know how to do either of those, as I've yet to find a tutorial or explanation.
The list of things I don't know here is dwarfed only by the list of things I don't know to ask. If I knew of a book that touched on any of these things I'd certainly buy it, but they seem to be more oriented toward building RIAs and such.
Oh, yes, it is my intention to let Eclipse do its thing, rather than simply running Ant from within Eclipse.
Perhaps my initial post should have been less Ant oriented and more along the lines of how to move an existing project into Eclipse. If I could see an example of how to do that I'd be in a much better position to ask intelligent questions. Indeed, I might even know what to ask.
Let's just say I have my existing web app classes, in the Subversion repository and a working copy on the local file system. We'll assume that I'm not even using Ant. What is the best way to bring this project into Eclipse?
|
|
|
Re: Migrating to Eclipse from Ant [message #509599 is a reply to message #509563] |
Sat, 23 January 2010 03:54  |
Eclipse User |
|
|
|
> What I had been hoping to find was a blog post or two saying "Well, this
> is how we did it.", to give me some ideas about what works and what
> doesn't work.
Sorry, I don't know about such collection, maybe others do?
But I'll try to answer a few individual questions:
> I don't know whether or how the existing directory structure may need to
> be changed. I don't know whether to use the New Project -> SVN ->
> Checkout Projects from SVN Wizard
Depending on which SVN plugin you use, yes the checkout wizard may give
you all relevant options to turn your project into an Eclipse project
( = add .project and .classpath files to the project's root directory).
> (and if so, how to specify the existing
> repository location - a typed URL simply doesn't 'take').
Subclipse, e.g., works fine with a full URL to a repository.
If the URL contains everything upto but not including the
standard trunk/branches/tags directories you should be fine, no?
> I don't know
> whether to start with the existing build.xml file and migrate away from
> it, or start from scratch and import needed functionality.
I'd try to remove everything related to just compiling from the ant file,
and make sure the JDT compiler is able to compile all your sources.
For additional tasks it depends ...
> Let's just say I have my existing web app classes, in the Subversion
> repository and a working copy on the local file system. We'll assume that
> I'm not even using Ant. What is the best way to bring this project into
> Eclipse?
For configuring a web app project, you probably get better answers in
http://www.eclipse.org/forums/eclipse.webtools
Or browse http://www.eclipse.org/webtools/community/
I see your point that this might be a long way asking around all
parts of the community.
Stephan
|
|
|
Powered by
FUDForum. Page generated in 0.03274 seconds