Use this template when writing standard Java code distributed as a jar file. This
script triggers unit testing (courtesy of JUnit) by overriding the dist target:
<?xml version="1.0"?>
<project name="mylib" basedir="." default="default">
<description>
+ ==\_/============J=A=V=A=G=E=N===A=N=T===M=O=D=U=L=E=S================= +
+ \(_)/ +
+ -(_)- Generic Java Library Build File +
+ /(_)\ +
+ ======================================================================= +
+
+ Your description goes here...
+
+ =J=A=M===========================================J=A=V=A=G=E=N=.=C=O=M= +
</description>
<property environment="env"/>
<property name="jam.home" location="${env.JAM_HOME}"/>
<property name="project.home" location="."/>
<import file="${user.home}/.ant/props-user.xml" optional="true"/>
<import file="${basedir}/src/jam/props-maven.xml" optional="true"/>
<import file="${project.home}/props-project.xml" optional="true"/>
<import file="${jam.home}/props-global.xml"/>
<import file="${basedir}/src/jam/classpath.xml"/>
<import file="${jam.home}/lib.xml"/>
<import file="${jam.home}/utest.xml"/>
<!-- =================================================================== -->
<!-- Override standard targets: -->
<!-- =================================================================== -->
<!-- override dist to include unit testing: -->
<target name="dist" depends="compile, test, jar" description="unit test and package jar distribution file"/>
</project>
Use this template for developing EJBs and doing in-container Cactus integration testing using JBoss 3.x.
<?xml version="1.0"?>
<project name="myejb" default="default" basedir=".">
<description>
+ ==\_/============J=A=V=A=G=E=N===A=N=T===M=O=D=U=L=E=S================= +
+ \(_)/ +
+ -(_)- EJB Build and Cactus Integration Testing on JBoss 3.x +
+ /(_)\ +
+ ======================================================================= +
+
+ Your description goes here...
+
+ =J=A=M===========================================J=A=V=A=G=E=N=.=C=O=M= +
</description>
<property environment="env"/>
<property name="jam.home" location="${env.JAM_HOME}"/>
<property name="project.home" location="."/>
<import file="${user.home}/.ant/props-user.xml" optional="true"/>
<import file="${basedir}/src/jam/props-maven.xml" optional="true"/>
<import file="${project.home}/props-project.xml" optional="true"/>
<import file="${jam.home}/props-global.xml"/>
<import file="${basedir}/src/jam/classpath.xml"/>
<import file="${jam.home}/appserver-jboss3.xml"/>
<import file="${jam.home}/ejb.xml"/>
<import file="${jam.home}/ejbtest-cactus.xml"/>
<import file="${jam.home}/testcycle.xml"/>
<!-- =================================================================== -->
<!-- Override standard targets: -->
<!-- =================================================================== -->
<!-- override dist to wrap EJBs in Cactus distribution file: -->
<target name="dist" depends="ejb.dist,itest.dist" description="generate target and test distribution files"/>
<!-- override to deploy Cactus distribution instead of EJB jar file: -->
<target name="deploy" depends="dist" description="deploys ejb and test archives to server">
<antcall target="appserver.deploy">
<param name="dist.name" value="${test.dist.name}"/>
</antcall>
</target>
<!-- override to undeploy Cactus distribution instead of EJB jar file: -->
<target name="undeploy" description="removes archive from server deploy folder">
<antcall target="appserver.undeploy">
<param name="dist.name" value="${test.dist.name}"/>
</antcall>
</target>
</project>
Use this template for developing web applications on JBoss 3.x.
<?xml version="1.0"?>
<project name="mywebapp" default="default" basedir=".">
<description>
+ ==\_/============J=A=V=A=G=E=N===A=N=T===M=O=D=U=L=E=S================= +
+ \(_)/ +
+ -(_)- Web App Build File for JBoss 3.x +
+ /(_)\ +
+ ======================================================================= +
+
+ Your description goes here...
+
+ Optional properties:
+ maven.type - set to 'war' or 'ear' to control distro type, default:'war'
+ build.classes.dir - redirect classes by setting this to '${basedir}/target/web/WEB-INF/classes'
+ webapp.context - context of web application, default: ${module.name}
+
+ =J=A=M===========================================J=A=V=A=G=E=N=.=C=O=M= +
</description>
<property environment="env"/>
<property name="jam.home" location="${env.JAM_HOME}"/>
<property name="project.home" location="."/>
<property name="build.classes.dir" location="${basedir}/target/web/WEB-INF/classes"/>
<import file="${user.home}/.ant/props-user.xml" optional="true"/>
<import file="${basedir}/src/jam/props-maven.xml" optional="true"/>
<import file="${project.home}/props-project.xml" optional="true"/>
<import file="${jam.home}/props-global.xml"/>
<import file="${basedir}/src/jam/classpath.xml"/>
<import file="${jam.home}/appserver-jboss3.xml"/>
<import file="${jam.home}/webapp.xml"/>
<!-- =================================================================== -->
<!-- Override standard targets: -->
<!-- =================================================================== -->
<!-- Leave classes un-jarred: -->
<target name="dist" depends="compile, manifest, war" description="package war"/>
</project>