I have a JSF project that supported with primefaces. I want to use ant script for complie and deployment operations. I created following build.xml. This Ant script is compiling and deploying project to jboss 7.1. But I could not create ant target for jboss stop and restart operation. I googled and found a ant task for old jboss version int this link:
How to start and stop jboss server using Ant task?
but Jboss 7.1 does not have "shutdown.bat" and "restart.bat" anymore.
Is there anyone who have experiences with this problem?
Thanks.
Build.xml:
<project default="run" basedir="." name="portal">
<property environment="env"/>
<property name="JBOSS_HOME" value="C:/jboss-as-7.1.1.Final"/>
<property name="JBoos.deployment.dir" value="${JBOSS_HOME}/standalone/deployments"/>
<property name="JBoos.bin" value="${JBOSS_HOME}/bin"/>
<property name="base" value="."/>
<property name="source" value="${base}/src"/>
<target name="run" depends="clean, compile">
<war warfile="portal.war" needxmlfile = "false" >
<fileset dir="${source}/main/webapp"/>
<classes dir="D:/portalAnt/WEB-INF/classes"/>
<lib file = "C:/MavenRepo/.m2/repository/org/primefaces/primefaces/3.5/primefaces-3.5.jar"/>
<metainf dir="D:/Personel/Dropbox/Java/primeFaces_WS/portal/target/m2e-wtp/web-resources/META-INF"/>
</war>
<antcall target="deployTarget"/>
<antcall target="startJboss"/>
</target>
<target name="deployTarget">
<copy file="${base}/portal.war" todir="${JBoos.deployment.dir}"/>
</target>
<target name="startJboss">
<exec executable="${JBoos.bin}/standalone.bat"/>
</target>
<target name="stopJboss">
</target>
<path id="MavenLib">
<!-- Maven libs are here. -->
</path>
<path id="JbossLib">
<!-- Jboss libs are here. -->
</path>
<path id="portal.classpath">
<path refid="MavenLib"/>
<path refid="JBossLib"/>
</path>
<target name="compile">
<javac includeantruntime="false" srcdir="./src" destdir="D:/portalAnt/WEB-INF/classes">
<classpath refid="portal.classpath"/>
</javac>
<mkdir dir="D:/portalAnt/WEB-INF/classes/META-INF"/>
<copy file="${base}/src/main/resources/META-INF/persistence.xml" todir="D:/portalAnt/WEB-INF/classes/META-INF"/>
</target>
<target name="clean">
<delete file ="${JBoos.deployment.dir}/portal.war"/>
</target>