You do not want to use ant -contrib. ant -contrib sucks, every time you use it, you get technical debt. One thing to keep in mind when using ant: let ant be ant. ant is what it is. he is declarative. The original intention of ant was a simple declaration of properties and with the meat of the work being done in java (where you had a real IDE with debugger and test environments). As noted in ant style elements - "Let ant be ant". If you need to use ant -contrib, you must create your own ant task. If you cannot do this, do not use ant. ant -contrib takes the worst of ant ant, makes it worse, you will soon find things unthinkable. Enough to rant.
, ... /tmp . .
<mapper id="zip" type="glob"
from="*"
to="*.zip"/>
<target name="zip-craziness">
<apply executable="zip">
<targetfile/>
<srcfile/>
<dirset dir="/tmp" />
<mapper refid="zip"/>
</apply>
</target>