-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
104 lines (91 loc) · 4.22 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<project name="Web Application" default="build" basedir=".">
<property file="${user.home}/build.properties"/>
<property file="build.properties"/>
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask"/>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask"/>
<path id="classpath">
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/shared/lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="init">
<tstamp/>
</target>
<target name="clean" description="Deletes the Web Application's war directory and web archive file">
<echo message="Deleting ${app.name}'s war directory and web archive file ..."/>
<delete dir="${basedir}/war" failonerror="false"/>
<delete file="${basedir}/${app.name}.war" failonerror="false"/>
</target>
<target name="prepare" description="Creates the Web Application's war directory" depends="init">
<echo message="Creating ${app.name}'s war directory ..."/>
<mkdir dir="${basedir}/war"/>
<mkdir dir="${basedir}/war/WEB-INF"/>
<mkdir dir="${basedir}/war/WEB-INF/classes"/>
<mkdir dir="${basedir}/war/WEB-INF/lib"/>
</target>
<target name="build" description="Builds the Web Application" depends="prepare">
<echo message="Building ${app.name} ..."/>
<javac srcdir="${basedir}/src" destdir="${basedir}/war/WEB-INF/classes">
<include name="**/*.java"/>
<classpath refid="classpath"/>
</javac>
<copy todir="${basedir}/war/WEB-INF">
<fileset dir="${basedir}/WEB-INF">
<include name="web.xml"/>
</fileset>
</copy>
<copy todir="${basedir}/war/WEB-INF/lib">
<fileset dir="${basedir}/WEB-INF/lib">
<include name="*.lib"/>
</fileset>
</copy>
<copy todir="${basedir}/war">
<fileset dir="${basedir}/">
<include name="**/*.html"/>
<include name="**/*.jsp"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
<include name="**/*.txt"/>
<include name="**/*.zip"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
<include name="**/*.png"/>
</fileset>
</copy>
<copy todir="${basedir}/war/META-INF">
<fileset dir=".">
<include name="context.xml" />
</fileset>
</copy>
</target>
<target name="package" description="Packages the Web Application's web archive file" depends="build">
<echo message="Packaging ${app.name}'s web archive file ..."/>
<delete file="${basedir}/${app.name}.war"/>
<jar jarfile="${basedir}/${app.name}.war">
<fileset dir="${basedir}/war" includes="**"/>
</jar>
</target>
<target name="deploy" description="Deploys the Web Application" >
<echo message="Deploying ${app.name} ..."/>
<deploy url="${manager.url}" username="${username}" password="${password}" path="/${kkuserid}/${app.name}"
war="file:${basedir}/${app.name}.war"/>
</target>
<target name="undeploy" description="Undeploys the Web Application" >
<echo message="Undeploying ${app.name} ..."/>
<undeploy url="${manager.url}" username="${username}" password="${password}" path="/${kkuserid}/${app.name}" failonerror="false" />
</target>
<target name="start" description="Start the Web Application" >
<echo message="Start the Web Application ..."/>
<start url="${manager.url}" username="${username}" password="${password}" path="/${kkuserid}/${app.name}"/>
</target>
<target name="stop" description="Stop the Web Application" >
<echo message="Stop the Web Application ..."/>
<stop url="${manager.url}" username="${username}" password="${password}" path="/${kkuserid}/${app.name}" failonerror="false" />
</target>
</project>