Eclipse 3.1 ANT Build File Import/Export
What's New in Eclipse 3.1
— Since Eclipse's first release in 2001, it has become a popular environment for Java development. In the period between March 10 and May 11, 2005, users downloaded over 17,000 copies of one of the production SDK releases and over 3,500 copies of one of the stable (milestone) SDK builds on average every day. A vibrant eco-system of developers, plug-in providers, authors, and bloggers has grown up around it. Eclipse has also gained the backing of the key Java vendors including BEA, Borland, IBM, SAP, and Sybase. Developers like Eclipse because it provides a great platform for building Java applications, and companies like it because it unifies their software tools under one open source umbrella.
I was reading this article on JDJ about new features in Eclipse 3.1. One feature mentioned that caught my eye was the ability to set a project based on an existing ANT build file, and the ability to export a project settings to an ANT build file. Unfortunately the article didn't explain how to do this import/export. I searched Eclipse's help, to no avail. After some messing around with eclipse I found out how to do it.
To export your project settings to an ANT build file:
- Right click on any file in your project and click on "export" (thanks to Scott Stanchfield for clarifying that any file in the project will do).
- On the window that pops up, select "Ant Buildfiles" and click on "next".
- Select the appropriate project to use to generate the ANT buildfile.
- Click "finish".
Any custom targets you create should go on build-user.xml, since build.xml will be overwritten every time a build file is generated.
To create a project from an existing ANT buildfile:
- Click on File->New->Project
- Select "Java Project from existing Ant Buildfile" and click "next".
- Enter a project name, and select the build file to use to create the project.
- Select the javac declaration to be used to define the project.
- Click "finish".
18 Comments:
Nice explanation, thanks.
By Ed Burnette, At 11:31 PM
You don't need to right-click on the .project file. Any file/folder (or the project itself) will do.
By Anonymous, At 10:06 AM
Good to know, thanks.
By David Heffelfinger, At 3:00 AM
Do not you mind being referenced there http://eclipsewiki.editme.com/ANTFaq?
By Anonymous, At 6:20 PM
Sam,
I don't mind being referenced, please do.
Thanks,
David
By David Heffelfinger, At 10:22 AM
what if i have 2 different javac targets ?
say one that builds project and other that builds the unit tests
By Anonymous, At 7:05 AM
If your buildfile has multiple javac declarations, you are prompted to select the javac declaration that makes sense for building the project.
By Anonymous, At 5:55 PM
after doing the export of the Ant Build files those two files, build.xml and build-user.xml show in the problems list with
Severity Description Resource In Folder Location Creation Time Id
2 3:2 The markup in the document following the root element must be well-formed. build-user.xml INVENTJobQ line 3 January 3, 2006 12:48:26 PM 11700
Is there any way to eliminate that problem reporting so I don't see the little red X on ALL my projects?
By Ollie, At 3:58 PM
Shame the import doesn't work if the javac is inside a conditional statement in the build file.
By Unknown, At 4:47 AM
Very useful blog for software development export and import so thanks allot for shearing this suggestion.
By hire a php programmer, At 6:42 AM
Was looking for this trick for several days. Thanks so much.
By Mohammad Javad Dousti, At 1:46 AM
I have a project which contain webroot folder like we have in dynamic web project. But I am not able to get the webroot folder in the hierarchy of the project. Can anyone tell me how to get the proper project?
By Nimit Jain, At 7:49 AM
I have been using ant for the first time. Please reply how to use build.xml with ant to get a proper hierarchy which must include webroot folder. Thanks in advance
By Nimit Jain, At 7:51 AM
nice, thanks
By Anonymous, At 10:04 AM
This is one of the awesome and good application.I like your blog strategy.This is one of the perfect post.Good.
By Android app developers, At 4:43 AM
Thanks dear this is pretty useful blog for Program Development Company
export and import so thanks allot for shearing this suggestion.
By Unknown, At 7:17 AM
Hello !Thank you so much for this amazing article and please keep update like this excellent post.
Digital Marketing In Delhi
E-Commerce Solution in delhi
By Unknown, At 3:29 AM
I enjoyed reading your post. Please continue publishing helpful information like this. I like this type of information and share my opinion with you.
Brand Development Company | Travel Technology Software | Software Development Solutions | Web Design Company in India | Mobile App Development Company
By Catabatic Technology, At 5:48 AM
Post a Comment
Subscribe to Post Comments [Atom]
<< Home