-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
102 lines (94 loc) · 4.25 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." name="ROOT" default="war.all" >
<property name="name" value="ROOT" />
<property environment="env"/>
<property file="${user.home}/${name}.properties"/>
<property file="${user.home}/build.properties"/>
<property name="config.filename" value="${user.name}.properties"/>
<property file="${config.filename}"/>
<property file="build.properties"/>
<property name="project.base.dir" value="." />
<property name="src" value="${project.base.dir}/main/java" />
<property name="resources" value="${project.base.dir}/main/resources" />
<property name="WebContent" value="${project.base.dir}/WebContent" />
<property name="test" value="${project.base.dir}/test" />
<property name="build" value="${project.base.dir}/build" />
<property name="war" value="${build}/war" />
<property name="dist" value="${project.base.dir}/dist" />
<property name="classes" value="${war}/WEB-INF/classes" />
<property name="warlib" value="${war}/WEB-INF/lib" />
<property name="lib" value="${build}/lib" />
<property name="external" value="${build}/external" />
<property name="external.dir" location="${external}" />
<property name="external.jars" value="${build}/external/lib" />
<property name="hudson.url" value="jenkins.momentumsoftware.com:8080/" />
<property name="maven.compat" value="true"/>
<property name="target.war" value="${lib}/${name}.war"/>
<property name="dist.suffix" value="" />
<property name="toughresources" value="TopStackResources${dist.suffix}" />
<property name="toughresources.dir" value="${project.base.dir}/../${toughresources}"/>
<import file="${toughresources.dir}/common.build.xml" />
<target name="init">
<mkdir dir="${build}" />
<mkdir dir="${classes}" />
<mkdir dir="${warlib}" />
<mkdir dir="${lib}" />
<mkdir dir="${external}" />
<mkdir dir="${external.jars}" />
</target>
<target name="dist" depends="clean, compile.src" >
<mkdir dir="${dist}" />
<war destfile="${dist}/${name}.war" webxml="${WebContent}/WEB-INF/web.xml">
<mappedresources>
<fileset refid="topstack.runtime.deps"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*.jar" to="WEB-INF/lib/*.jar" />
</chainedmapper>
</mappedresources>
<metainf dir="${WebContent}/META-INF">
<include name="context.xml"/>
</metainf>
<webinf dir="${WebContent}/WEB-INF">
<include name="urlrewrite.xml"/>
</webinf>
<classes dir="${classes}" excludes="**/Test*.class"/>
<manifest/>
</war>
</target>
<target name="war.all" depends="compile.src" >
<war destfile="${lib}/${name}.war" webxml="${WebContent}/WEB-INF/web.xml">
<mappedresources>
<fileset refid="topstackcore.deps"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*.jar" to="WEB-INF/lib/*.jar" />
</chainedmapper>
</mappedresources>
<metainf dir="${WebContent}/META-INF">
<include name="context.xml"/>
</metainf>
<webinf dir="${WebContent}/WEB-INF">
<include name="urlrewrite.xml"/>
</webinf>
<classes dir="${classes}" excludes="**/Test*.class"/>
<manifest/>
</war>
</target>
<target name="maven.deploy" depends="dist, maven.deploy.war">
</target>
<!-- redefine target; since this is root, path is special. -->
<target name="deploy" description="Install application in Tomcat" if="deploy.ip" depends="clean, war.all, db.migrate.current">
<echo message="Deploying root webapp to Tomcat on ${deploy.ip}"/>
<subant target="undeploy" failonerror="false" >
<fileset dir="." includes="build.xml"/>
<property name="path" value="/"/>
<property name="name" value=""/>
</subant>
<deploy url="${deploy.url}"
username="${deploy.username}"
password="${deploy.password}"
path="/"
war="file:${lib}/${name}.war"/>
</target>
</project>