This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathinstall_tomcat.xml
44 lines (40 loc) · 2.07 KB
/
install_tomcat.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="init" default="all">
<property name="tomcat.home" value="apache-tomcat"/>
<target name="downloadTomcat" depends="tomcat.check" unless="tomcat.exists">
<property name="tomcat.version" value="7.0.70"/>
<property name="tomcatMirror" value="http://archive.apache.org"/>
<property name="tomcatMirrorPath" value="/dist/tomcat/tomcat-7/v${tomcat.version}/bin"/>
<property name="tomcatName" value="apache-tomcat-${tomcat.version}"/>
<get src="${tomcatMirror}/${tomcatMirrorPath}/${tomcatName}.zip" dest="${tomcatName}.zip"/>
<unzip src="${tomcatName}.zip" dest=""/>
<rename src="${tomcatName}" dest="apache-tomcat"/>
<delete file="${tomcatName}.zip"/>
<delete includeemptydirs="true">
<fileset dir="apache-tomcat/webapps" includes="**/*"/>
</delete>
<chmod file="${tomcat.home}/bin/catalina.sh" perm="777"/>
<antcall target="getMySQLConnector"/>
</target>
<target name="getMySQLConnector">
<property name="connector.version" value="5.1.38"/>
<get src="http://downloads.mysql.com/archives/get/file/mysql-connector-java-${connector.version}.zip"
dest="mysql-connector-java.zip"/>
<unzip src="mysql-connector-java.zip" dest="">
<patternset>
<include
name="mysql-connector-java-${connector.version}/mysql-connector-java-${connector.version}-bin.jar"/>
</patternset>
</unzip>
<move file="mysql-connector-java-${connector.version}/mysql-connector-java-${connector.version}-bin.jar"
tofile="${tomcat.home}/lib/mysql-connector-java.jar"/>
<delete dir="mysql-connector-java-${connector.version}" includeemptydirs="true"/>
<delete file="mysql-connector-java.zip"/>
</target>
<target name="tomcat.check">
<condition property="tomcat.exists">
<available file="${tomcat.home}" type="dir"/>
</condition>
</target>
<target name="all" depends="downloadTomcat"/>
</project>