5.4. Creating a HARNow that we created the HBM files and the Hibernate MBean service deployment descriptor, we are ready to bundle things up and deploy it as a part of the EAR. Hibernate applications are bundled up in a Hibernate Archive (HAR). We use the standard Ant <jar> task in Example 5-5 to create the HAR. Example 5-5. build.xml<!-- ====================================== --> <target name="har" depends="generate-hbm" description="Builds the Hibernate HAR file"> <mkdir dir="${distribution.dir}" /> <jar destfile="${distribution.dir}/jaw.har"> <!-- include the hbm.xml files --> <fileset dir="${gen.source.dir}"> <include name="**/*.hbm.xml"/> </fileset> <!-- include hibernate-service.xml --> <metainf dir="${hibernate.dir}"> <include name="hibernate-service.xml"/> </metainf> </jar> </target> |