This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes target getting called more than once. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "target getting called more than once." Watch "target getting called more than once." New topic
Author

target getting called more than once.

hasan khan
Ranch Hand

Joined: Aug 04, 2003
Posts: 222

in the following build.xml my problem is echo target is getting call 3 times when i call target compileall. only want it to call only once.


[ May 26, 2006: Message edited by: hasaN khaN ]


SCJP, SCWCD
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The targets "admin", "common" and "login" all depend on the target "echo". Call any of them and echo will be run first. Call all of them and echo will be called once for each target.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

Hasan,
If you rewrite compileall, echo will only be called once:

The antCall in the original code makes each target execute in a separate environment so it doesn't know that echo has already been called.


[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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: target getting called more than once.
 
Similar Threads
Ant, windows xp, and a funky infinite loop
Eclipse 3.3, Glassfish, WebServices and wsimport
hierarchical ant scripts
Compiled files are compiling again.
Loops in Ant