forked from devopstechnologies/Ant-WebProject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-mt.xml
70 lines (57 loc) · 2.14 KB
/
build-mt.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="${project.name}" default="init" basedir=".">
<property file="./build.properties" />
<target name="init" depends="prepare,compile,war" description="Clean work directories, then compile and create a WAR then create the EAR">
<echo> Build completed for ${project.name} </echo>
</target>
<!-- Define the CLASSPATH -->
<path id="compile.classpath">
<fileset dir="${web.home}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<pathelement path="${work.home}"/>
</path>
<target name="prepare" description="Create working dirs and copy static files to work dir">
<mkdir dir="${dist.home}"/>
<mkdir dir="${work.home}/WEB-INF/classes"/>
<mkdir dir="${war.home}"/>
<!-- Copy static HTML and JSP files to work dir -->
<copy todir="${work.home}">
<fileset dir="${web.home}"/>
</copy>
</target>
<target name="compile"
description="Compile Java sources and copy to WEB-INF/classes dir">
<javac srcdir="${src.home}"
destdir="${work.home}/WEB-INF/classes" includeantruntime="yes">
<classpath refid="master-classpath"/>
</javac>
<copy todir="${work.home}/WEB-INF/classes">
<fileset dir="${src.home}" excludes="**/*.java"/>
</copy>
</target>
<!-- Define the CLASSPATH -->
<path id="master-classpath">
<fileset dir="${web.home}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<pathelement path="${work.home}"/>
</path>
<target name="war"
description="Create WAR file for binary distribution">
<war destfile="${war.home}/${app.name}.war" webxml="${work.home}/WEB-INF/web.xml">
<fileset dir="${work.home}"/>
<classes dir="${work.home}/WEB-INF/classes"/>
</war>
<copy file="${war.home}/${app.name}.war" todir="${dist.home}" overwrite="true" />
</target>
<target name="ear" >
<ear destfile="${dist.home}/${ear.name}" appxml="${app.home}/application.xml" update="true">
<fileset dir="${war.home}" includes="*.jar,*.war"/>
<metainf dir="${app.home}" excludes="application.xml"/>
</ear>
<delete file="${dist.home}/${app.name}.war" />
<delete dir="${war.home}" />
<delete dir="${work.home}" />
</target>
</project>