<project name="jsfhtml" default="deploy">
    <target name="compile">
        <delete dir="bin\demo"/>
        <javac srcdir="src" destdir="bin" classpath="C:\Apache\apache-tomcat-8.5.12\lib\myfaces-bundle-2.2.12.jar;C:\Apache\apache-tomcat-8.5.12\lib\annotations-api.jar"/>
    </target>
	<target name="pack" depends="compile">
        <war warfile="test.war" webxml="web.xml">
            <classes dir="bin" includes="**/*.class"/>
            <fileset dir="facelet" includes="*.xhtml"/>
            <webinf dir="." includes="beans.xml"/>
            <webinf dir="." includes="faces-config.xml"/>
            <metainf dir="." includes="Context.xml"/>
        </war>
	</target>
    <target name="deploy" depends="pack">
    	<exec executable="cmd" dir="C:\Apache\apache-tomcat-8.5.12\bin">
    	    <arg value="/c"/>
   	        <arg value="shutdown"/>
   	    </exec>
    	<sleep milliseconds="1000"/>
        <delete dir="C:\Apache\apache-tomcat-8.5.12\work" failonerror="false"/>
        <delete dir="C:\Apache\apache-tomcat-8.5.12\webapps\test" failonerror="false"/>
        <copy file="test.war" todir="/Apache/apache-tomcat-8.5.12/webapps"/>
        <exec executable="cmd" dir="C:\Apache\apache-tomcat-8.5.12\bin">
            <arg value="/c"/>
            <arg value="startup"/>
        </exec>
	</target>
</project>