File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30973
    
159

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.