• 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

Forcing a wait before completion on ant targets

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there! I'm building an ant script that needs to stop the server, copy some files and then start it again.
I'm using antcall to start/stop the server. So when I run my task it begins to stop the server, but it calls the start before the shutdown was donne.

How can I force the completion of the first antcall before the second is started?

Regards
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Difficult. You can use the <waitfor /> task with nested socket and http elements to wait until the server stops responding. However in my experience this is not too reliable, though it may be worth a try (who knows, you may have better luck than I did). What I did that worked was write a custom task to tail the server log for a know "shutdown" log message. Once that arrived I assumed the server has properly shutdown and let Ant carry on.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think Ant also has a sleep task if everything else fails.
reply
    Bookmark Topic Watch Topic
  • New Topic