my dog learned polymorphism
The moose likes Ant, Maven and Other Build Tools and the fly likes scp ant task: fail if directory is empty 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 "scp ant task: fail if directory is empty" Watch "scp ant task: fail if directory is empty" New topic
Author

scp ant task: fail if directory is empty

nlr reddy
Greenhorn

Joined: Jul 05, 2009
Posts: 9
Hi,

I'm using the below code to scp a file to remote dir. but how can I fail the build if local directory is empty? I'have used failonerror=true for scp task but the execution of ant build says build successful even if there is no file.



Thanks,
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32481
    
214

You can use the resourcecount condition to fail before calling scp.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: scp ant task: fail if directory is empty
 
It's not a secret anymore!