• 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

what can I expect from ant

 
Trailboss
Posts: 23778
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All of my past experience with ant has been with somebody else making the scripts and we always used it to "build" (not "make").
If I have large app that includes a swing gui, jsp's, servlets, ejb's, etc. would I be able to create an ant script that can do a sort of make? As in, if I tweak a JSP, could I call ant with no parms and it would just re-build the war file without re-compiling any java or re-building any EJB's? And if I do tweak an EJB and call ant with no parms, would it recompile/rebuild just the one EJB? To do that, would I have to tell ant about every EJB?
 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The short answer is, what you're describing, Ant can do.
Check out the Ant scripts in the Java Pet Store reference application. They use Ant for everything, from compiling, to jarring, to deploying. And that'll cover servlets, EJBs, JSPs, a Swing GUI, etc.
 
paul wheaton
Trailboss
Posts: 23778
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Will I have to tell the ant build.xml file about every bean to keep it from processing all beans if I change just one?
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Wheaton:
Will I have to tell the ant build.xml file about every bean to keep it from processing all beans if I change just one?


What Application Server are you using? Ant's optional libraries have some nice tags for building to specific App Servers. For example, there is a tag for WebLogic that will build your ejb jar and then run ejbc on it. If the class files have not changed since the last build then the ejb jar will not be rebuilt. I definitely suggest you look into this. Here is a link:
ejbjar Task Documentation.
[ January 14, 2003: Message edited by: Chris Mathews ]
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to tell build.xml how to build each jar file, of course. That is, you have to tell Ant what files to jar up. If you change a single source file, then only the jar (or jars) that depend on it will be rebuilt.
I'm not clear on the distinction you're drawing between "make" and "build".
 
paul wheaton
Trailboss
Posts: 23778
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"make" will do only the minimum amount of work that has to be done.
"build" will do a "clean" first, thus requiring all tasks to be done.
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By that definition, Ant is definitely a make tool. (This is true as long as you follow Ant's rules so that it can determine if a file has been changed.)
[ January 14, 2003: Message edited by: Thomas Paul ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic