aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant and Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant and "automatic build" of Eclipse" Watch "Ant and "automatic build" of Eclipse" New topic
Author

Ant and "automatic build" of Eclipse

Karim Kiswarday
Ranch Hand

Joined: Oct 01, 2010
Posts: 50

Hi friends,
I'm new with Ant.

I use Eclipse as IDE and so far, when I save my .java file, Eclipse compiles it automatically.
Now I'm starting to use Ant and I read everywhere to create a task to compile my java files, but I think it's unnecessary in my case.
I think it's useful only when someone doesn't use the "automatic build" during the development.

Can you confirm that?

P.S.
Are there some cases where is better to disable the automatic build of Eclipse and use Ant?

Thanks
Karim


No fun at the table, no fun in the sack.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

Karim,
If you want the auto build to do something that you can't do in an Eclipse builder. Or if some of the team is using Eclipse and some of the team is using another IDE.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

The Eclipse builders can do basic project build stuff, but not really complex things like constructing a WAR. And, although technically you could gimmick up a set of custom builders to do so, it's a lot easier just to let Ant or Maven do that kind of work.

Eclipse will (by default) automatically compile Java source code when you save it. However it won't automatically do the other things that a complex project requires like building up the WAR's WEB-INF/lib directory, so to get an actual usable WAR (for example), you can run Ant within Eclipse using the Run Ant Eclipse command.

A well-designed project has an Ant build xml that can run either within Eclipse or stand-alone without Eclipse installed. Mostly that just means that the build.xml includes a Java compile task so it doesn't have to depend on Eclipse to do the compiling. Unless it wants to.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ladislav Lencucha
Greenhorn

Joined: Oct 28, 2012
Posts: 2
Actually, Eclipse is able to construct the WAR structure in a very comfortable way. You only have to install the appropriate plugins (or directly download Eclipse for Java EE developer) and choose the correct project type (Dynamic Web Application).

Ant is good as a universal build tool available on every platform without the need of Eclipse beeing installed (ant2 is a 2MB zip file) and able to do execute complex tasks (not only build) and can be easily extended to do almost everything. You can use it to schedule nightly build and all that nice to have stuff.

If you only need to build a web application, Eclipse is enought. If you plan to work in team and do complicated things go for ant, or even better, combine them.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Ant and "automatic build" of Eclipse
 
Similar Threads
NetBeans and Hudson integration
Using Eclipse as a Java editor
Eclipse Spring IDE plugin add folder
Really Cool for ANT build.
Using Eclipse 3.1.0 IDE, JBOSS 4.0.0 server & ANT as build tool