• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 405
  • Last Modified:

Why should i not use NetBeans and stop worrying about ANT

Why do we need Java ant. I know that it incrementally compiles java source code and provides a way for the programmer to define this process in an XML file. I dont know Ant!!!

Why cant i write my application in an Netbeans IDE (which comes with TOMCAT), and let the IDE worry about compiling and running the code, which ever way it wants to. Why do i need Ant then. It adds over head...to learn Ant and write the build process (in XML). The IDE comes with Tomcat which i learnt just now. Since yesterday, i have been spending time dowloading TOMCAT and JavaANT and setting environment variables.. Can any one help me understand why i should not let IDE worry about everything?

and this process does not tell me how to link these separate tools to make a java application
2 Solutions
I'm not a NetBeans expert (I use Eclipse), but I assume it is like Eclipse.  You are correct, the IDE lets you test your application.  Then, when you are ready to deploy the tested app, you can package the app into a jar, war, or ear.  Copy the archive for the app into the proper directory as described here:

Deploying Web Applications to Tomcat

We use Ant primarily for two things:
(1) Local build testing - when I have made some changes, I run all the unit tests to make sure I haven't broken something before I release it.
(2) Continuous integration - each time changes are released to the team, it is integrated and tested on the development server.  A developer is done with changes once it passes integration testing.  Read more here:

Choosing a Continuous Integration server

You don't have to use Ant, especially if you are working alone.  However, a project of any size does need regression and integration tests to be run in an automated environment.  That is where Ant is often used (though the article above gives other alternatives).  These test should be available, since you should be following a test-driven development (TDD) approach IMO.
Though you are using NetBeans to build your application, you are actually calling ant to do it.

Check your file directory in your NetBeans, you should see a file named build.xml.

This is the default ant build script created for you at the beginning of your project.

The easiest way to learn ant is to customize this build script.

:-) Like it or not, you are still using it

Forced accept.

EE Admin

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now