You can't depend upon a directory, but you can package your dependencies as a zip, then tell Ivy to unpack them on download. This means when your application is built they will be available locally to the web server.
The packager provides an optional dest attribute that can be specified to unpack the archive to a sub folder. The following config should unpack the dependency to sub/dir
:
<property name="zipname" value="${name}-${version}"/>
<resource dest="sub/dir" url="http://testng.org/${zipname}.zip"
sha1="2ea19275dc17453306f8bb780fe6ef6e9af7756b">
<url href="http://mirror.example.com/archives/${zipname}.zip"/>
<include name="${zipname}/src/main/**/*"/>
<include name="${zipname}/src/jdk15/**/*"/>
<include name="${zipname}/javadocs/**/*"/>
<include name="${zipname}/*.jar"/>
</resource>