Skip to content

Instantly share code, notes, and snippets.

@an-sangkil
Last active August 29, 2015 14:15
Show Gist options
  • Save an-sangkil/22a8859e32c4058d2f8a to your computer and use it in GitHub Desktop.
Save an-sangkil/22a8859e32c4058d2f8a to your computer and use it in GitHub Desktop.
Ant File copy & deploy
<?xml version="1.0"?>
<project default="main" basedir=".">
<echo message="pulling in property files"/>
<!--
<copy todir="c:\test\kkkk\">
<fileset dir="c:\test\" >
<include name="**/*.*" />
<exclude name="" />
</fileset>
</copy>-->
<target name="tomcat.stop">
<echo>
</echo>
<exec dir="." executable="cmd">
<arg line="/c net stop Tomcat7" />
<!-- dir="C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin\"-->
<!--<arg line="/c Tomcat7.exe //RS//Tomcat7 " />-->
</exec>
</target>
<target name="copy">
<echo>
COPY START
WAS directory delete
</echo>
<delete includeemptydirs="true">
<fileset dir="C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\" includes="**/*" excludes="ROOT/**/*"></fileset>
</delete>
<echo message="WAR FILE DEPLOY"></echo>
<copy file="C:\Program Files (x86)\Jenkins\workspace\XXx1.0.X\com.xxxxx.ooooo.zzzzz.web\target\com.xxxxx.ooooo.zzzzz.web-1.0.15-SNAPSHOT.war"
tofile="C:\xxxxx\ooooo zzzzz \servers\ooooozzzzz.war" overwrite="true"></copy>
<!--<move file="" tofile=""></move>-->
</target>
<target name="tomcat.start">
<echo>
</echo>
<exec dir="C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin\" executable="cmd">
<arg line="/c net start Tomcat7" />
<!--<arg line="/c Tomcat7.exe //RS//Tomcat7 " />-->
</exec>
</target>
<target name="main">
<antcall target="tomcat.stop"></antcall>
<antcall target="copy"></antcall>
<antcall target="tomcat.start"></antcall>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment