Saturday, May 12, 2012

Configure Ant In Eclipse IDE

Eclipse is the software development IDE that is used widely by developer because of its ease of use and flexibility to have new/required features by installing Eclipse plug ins. Users can create new projects and develop source files and build the same. However in case of complex projects (Involving many dependent projects) Ant (Yet Another Tool) is used build the projects. Ant targets can be invoked from command prompt or from within Eclipse IDE itself by configuring Ant in Eclipse. In this article I'm going show how we can configure Ant in Eclipse and build software projects. This article assumes that you already have a ant build xml file with required ant targets to build your project.

1. Install Ant tool. Follow instructions available at http://ant.apache.org/manual/install.html
2. Update the environment variable PATH  to include the bin directory of Ant installation (Ex: D:\apache-ant-1.7.0\bin. This is required if you want to run ant targets from command prompt being in any directory location.
3. Open your eclipse IDE. Double click Eclipse.exe to open it and select Preferences off Window as shown below

4. Click 'Ant-Home' shown in red color below
5. Browse through the Ant-home location of your Ant installation and click OK to close the dialog


6. Open Ant View in eclipse as shown below


7.Add Ant builds as shown below

8. Browse to a valid ant build file and select. Eclipse lists all the ant targets available under that build xml file


9. Double click on the required ant target to run it. View the Eclipse Console for logs and you are done!


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...