• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ant and "automatic build" of Eclipse

 
Ranch Hand
Posts: 50
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic