forked from zippav/webshell-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
61 lines (50 loc) · 1.99 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
<project name="webshell" default="deploy" basedir=".">
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="result" location="result"/>
<property name="java.home" location="C:/prg/jdk1.8.0_25"/>
<property name="glassfish.password.file" location="C:/tmp/asadmin-password.txt"/>
<property name="glassfish.home" location="C:/prg/glassfish4/glassfish"/>
<property name="app" value="webshell"/>
<target name="clean">
<delete dir="${result}"/>
<mkdir dir="${result}"/>
<mkdir dir="${result}/classes"/>
</target>
<path id="lib.path.ref">
<fileset dir="WebContent/WEB-INF/lib" includes="*.jar"/>
<fileset dir="lib" includes="*.jar"/>
</path>
<target name="build" depends="clean">
<javac srcdir="${src}" debug="on" target="1.8" classpathref="lib.path.ref" destdir="${result}/classes"/>
<jar destfile="WebContent/WEB-INF/lib/${app}.jar">
<fileset dir="${result}/classes"/>
</jar>
<jar destfile="${result}/${app}.war">
<fileset dir="WebContent"/>
</jar>
<delete file="WebContent/WEB-INF/lib/${app}.jar"/>
</target>
<presetdef name="asadmin_deploy">
<java jar="${glassfish.home}/modules/admin-cli.jar" fork="true" jvm="${java.home}/bin/java">
<arg line="" />
<arg line="--port 4848 --user admin --passwordfile ${glassfish.password.file} --host localhost deploy --force=true --properties compatibility=v2 ${result}/${app}.war" />
</java>
</presetdef>
<presetdef name="asadmin_undeploy">
<java jar="${glassfish.home}/modules/admin-cli.jar" fork="true" jvm="${java.home}/bin/java">
<arg line="" />
<arg line="--port 4848 --user admin --passwordfile ${glassfish.password.file} --host localhost undeploy ${app}" />
</java>
</presetdef>
<target name="undeploy" depends="build">
<asadmin_undeploy failonerror="false">
<arg value="" />
</asadmin_undeploy>
</target>
<target name="deploy" depends="undeploy">
<asadmin_deploy failonerror="true">
<arg value="" />
</asadmin_deploy>
</target>
</project>