I built the following ant-task for deployment based on the jboss deployment docs:
<target name="deploy" depends="jboss.environment, buildwar">
<!-- Build path for deployed war-file -->
<property name="deployed.war" value="${jboss.home}/${jboss.deploy.dir}/${war.filename}" />
<!-- remove current deployed war -->
<delete file="${deployed.war}.deployed" failonerror="false" />
<waitfor maxwait="10" maxwaitunit="second">
<available file="${deployed.war}.undeployed" />
</waitfor>
<delete dir="${deployed.war}" />
<!-- copy war-file -->
<copy file="${war.filename}" todir="${jboss.home}/${jboss.deploy.dir}" />
<!-- start deployment -->
<echo>start deployment ...</echo>
<touch file="${deployed.war}.dodeploy" />
<!-- wait for deployment to complete -->
<waitfor maxwait="10" maxwaitunit="second">
<available file="${deployed.war}.deployed" />
</waitfor>
<echo>deployment ok!</echo>
</target>
${jboss.deploy.dir}
is set to standalone/deployments