Check out Aries project and from esa-ant-task project run mvn clean install, add the generated jar from the target directory to your ant classpath
e.g. ~/.ant/lib , or $ANT_HOME/lib etc.,

The following example shows how this task could be integrated into an existing ant build script,

<projectname="An ant example for esa-ant"default="default"><description>
A simple build file to demonstrate the use of esa-ant task
</description><taskdefname="esa"classname="org.apache.aries.ant.taskdefs.EsaTask"/><targetname="default"description="builds esa with supplied SUBSYSTEM.MF"><esadestfile="demo.esa"symbolicname="test-esa"manifest="${basedir}/SUBSYSTEM.MF"><filesetdir="/tmp/esa-ant-demo"><includename="*.jar"/></fileset></esa></target><targetname="default2"description="generates the SUSBYSTEM.MF based on esa contents"><esadestfile="demo2.esa"symbolicname="test-esa"generatemanifest="true"><filesetdir="/tmp/esa-ant-demo"><includename="*.jar"/></fileset></esa></target></project>