Starting stopping JBoss server using Ant target instead of exec and
pass the run script i.e.
build.xml
<target="start-jboss" description="Starts JBoss instance" depends="prepare">
<exec dir="${jboss.home}/bin" executable="cmd.exe" os="Windows07">
<arg line="/c run.bat -S"/>
<env key="NOPAUSE" value="true"/>
</exec>
</target>
Take a look at Cargo.
There is also a way to stop JBoss via JMX Console or even pure JMX (requires custom ant task adapter).