aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes When to use ANT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "When to use ANT" Watch "When to use ANT" New topic
Author

When to use ANT

M.K.A. Monster
Ranch Hand

Joined: May 02, 2002
Posts: 130
Hello,
I'd like to know when I should use ANT.
For example, when I'm building a very small app, just 10 classes. I can do this very well with just putting javac on the commandline. Without all the trouble of creating the build.xml file.
What is the real purpose for using ANT. Is it meant for large scale applications? Or is it also meant for applets, midlets and even WebApplications.
And why sould I not just use the building done by the IDE I use?
Regards,
Mark Monster
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by M.K.A. Monster:
What is the real purpose for using ANT. Is it meant for large scale applications? Or is it also meant for applets, midlets and even WebApplications.

As usual, with small projects a lot of tools become an overhead. Where the line goes there is no saying (how do you differentiate a large scale application from a small scale application anyway?). You have to list the pros and cons, take a moment and decide whether an Ant script is beneficial for your particular project.
Some benefits to consider:
- The build process is repeatable
- The build process is centrally managed
- The build process can be configured
- The build script is structured better
- Additional features can be added without hassle (such as automatic metrics, enforcing coding convention, automatic deployment, automatic backup, and the list goes on)

Originally posted by M.K.A. Monster:
And why sould I not just use the building done by the IDE I use?

If it feels good, it is good. The question is do you need something that the IDE doesn't provide? If you don't then why change anything?
The IDE features are enough for a personal project missing some "bigger picture" views such as release cycles but as these become necessary, the IDE won't flex enough. Furthermore, the next developer may not use the same IDE as you do...


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I find ant useful for even very small projects. In particular I find its easy integration with JUnit, the ability to automatically create "jar" files of applications, and the way it can be used to back up my source code to another directory or zip file to make it easier to go back to old versions.
If your IDE really allows you to build, test, package in a jar, produce javadoc and then run your software with just one button, it may be good enough to avoid the need for something like Ant (for now, at least). If doing all of that requires more than one button click, you should consider automating the process, and Ant is a good place to start.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Eric Fletcher
Ranch Hand

Joined: Oct 26, 2000
Posts: 188
I'm with Frank on this one, IDEs make life easier but none that I have found can do what ant does. I recently started using ant and I honestly wonder how I ever got along without it. There is a little bit of a learning curve, but the ant documentation is very good and it is well worth the effort. Even on small projects I think you will be happy with what it can do.
E


My theory of evolution is that Darwin was adopted. - Steven Wright
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

When someone starts using ANT, het finds it convenient even for small projects. You just have to prepare the build.xml file once and then have fun. The rest is yours.


Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When to use ANT
 
Similar Threads
Considering Hibernate Please help
ANT and Log4J
Maven or Ant?
Different Tools: Java & Others.
Cruise Control : Multiple projects in Config.xml