-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathasl-java-war.xml
95 lines (84 loc) · 4.4 KB
/
asl-java-war.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
<?xml version="1.0" encoding="utf-8"?>
<!--
********************************************************************************
* Ant Script Library - Java war module
* Targets to create a war
* Module property prefix: "java-war"
********************************************************************************
* Copyright 2009 Joe Schmetzer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
********************************************************************************
-->
<project name="asl-java-war">
<dirname property="asl-java-war.basedir" file="${ant.file.asl-java-war}"/>
<import file="${asl-java-war.basedir}/asl-java-build.xml"/>
<property name="java-war.libs-dir" location="${common.target-dir}/war-libs"/>
<property name="java-war.web-content-dir" location="src/main/webapp"/>
<property name="java-war.web-xml-file" location="${java-war.web-content-dir}/WEB-INF/web.xml"/>
<property name="java-war.webapp-name" value="${ant.project.name}"/>
<property name="java-war.deploy-base" location="${tomcat.home}/webapps"/>
<property name="java-war.deploy-dir" location="${java-war.deploy-base}/${java-war.webapp-name}"/>
<!-- ***********************************************************************
* target: war
************************************************************************ -->
<target name="war" depends="compile, copy-resources, jar, -init-time, -init-war-file-name, -war-prepare-libs"
description="Create a war for this web project">
<mkdir dir="${common.dist-dir}"/>
<property name="java-war.compress" value="true"/>
<property name="java-war.build-id" value="Built by ${user.name} at ${common.timestamp} running on ${os.name} ${os.version} ${os.arch}"/>
<war destfile="${java-war.dist-file}"
webxml="${java-war.web-xml-file}"
compress="${java-war.compress}">
<fileset dir="${java-war.web-content-dir}" />
<manifest>
<attribute name="Build-Id" value="${java-war.build-id}"/>
</manifest>
<lib dir="${java-war.libs-dir}"/>
</war>
</target>
<!-- ***********************************************************************
* target: -init-war-file-name
************************************************************************ -->
<target name="-init-war-file-name">
<property name="java-war.dist-filename" value="${ant.project.name}-${java-build.jar-version}.war"/>
<property name="java-war.dist-file" location="${common.dist-dir}/${java-war.dist-filename}"/>
</target>
<!-- ***********************************************************************
* target: -war-prepare-libs
************************************************************************ -->
<target name="-war-prepare-libs" depends="-init-war-libs">
<mkdir dir="${java-war.libs-dir}"/>
<copy todir="${java-war.libs-dir}">
<path refid="java-war.libs-path"/>
<mapper type="flatten"/>
</copy>
<copy todir="${java-war.libs-dir}" file="${java-build.jar-file}"/>
</target>
<!-- ***********************************************************************
* target: -init-war-libs
************************************************************************ -->
<target name="-init-war-libs">
<path id="java-war.libs-path">
<path refid="java-build.runtime-classpath"/>
</path>
</target>
<!-- ***********************************************************************
* target: war-deploy
************************************************************************ -->
<target name="war-deploy" depends="war"
description="Deploys the war to the application server">
<unwar src="${java-war.dist-file}"
dest="${java-war.deploy-dir}"/>
</target>
</project>