-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildLinux.xml
102 lines (87 loc) · 3.48 KB
/
buildLinux.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
<project name="Practical Case Study Web service" default="all" basedir=".">
<description>
This is a file that compiles and distributes the Case Study, which appears
sample tutorials UOC </description>
<!-- definition of global property -->
<property environment="env"/>
<property name="jboss.home" value="${env.JBOSS_HOME}"/>
<property name="source" value="."/>
<property name="sourcesrc" value="${source}/src"/>
<property name="build" value="${source}/build"/>
<property name="buildjar" value="${build}/jar"/>
<property name="buildwar" value="${build}/war"/>
<property name="dist" value="${source}/dist"/>
<property name="jboss-config" value="default"/>
<property name="deploy" value="${jboss.home}\standalone\deployments"/>
<property name="jboss.module.dir" value="${jboss.home}/modules" />
<path id="jboss.classpath">
<fileset dir="${jboss.module.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="all" depends="clean, init, compileEjb, compileWar, jarEjb, deployClient,
ear, deployear"/>
<target name="init"
description = "inicialitzacions is relevant: the structure created
copy files and directories there. xml "> <!-- Crea el time-stamp -->
<tstamp/>
<!-- It creates the directory structure -->
<mkdir dir="${buildjar}"/>
<mkdir dir="${buildwar}"/>
<mkdir dir="${buildjar}/META-INF"/>
<mkdir dir="${buildwar}/WEB-INF"/>
<mkdir dir="${buildwar}/WEB-INF/classes"/>
<mkdir dir="${dist}"/>
</target>
<!--Compiling the EJB classes and makes the build directory -->
<target name="compileEjb" depends="init">
<copy file="${sourcesrc}/META-INF/persistence.xml" todir="${buildjar}/META-INF"/>
<copy file="${sourcesrc}/log4j.properties" todir="${buildjar}"/>
<javac srcdir="${sourcesrc}" destdir="${buildjar}"
includes="ejb/*.java, jpa/*.java"
classpathref="jboss.classpath"
includeantruntime="true"
/>
</target>
<!-- Compile the client application, creating the structure buildwar -->
<target name="compileWar" depends="compileEjb">
<copy todir="${buildwar}">
<fileset dir="${source}/docroot"/>
</copy>
<javac srcdir="${sourcesrc}" destdir="${buildwar}/WEB-INF/classes" includes="managedbean/*.java"
classpathref="jboss.classpath"
includeantruntime="true"
/>
</target>
<!-- Update the EJB jar file and create if not exist -->
<target name="jarEjb" depends="compileEjb">
<jar jarfile="${dist}/PracticalCaseStudyJEE.jar"
basedir="${buildjar}"
update="yes">
</jar>
</target>
<!-- Update the WAR file and create if not exist -->
<target name="deployClient" depends="compileWar">
<jar jarfile="${dist}/PracticalCaseStudyJEE.war"
basedir="${buildwar}"
excludes="/WEB-INF/classes/ejb/*.*, /WEB-INF/classes/jpa/*.*"
update="yes">
</jar>
</target>
<!-- Update the application ear file and created if not exist -->
<target name="ear" depends="clean, jarEjb, deployClient">
<copy file="${sourcesrc}/META-INF/application.xml" todir="${dist}/META-INF"/>
<jar jarfile="${dist}/PracticalCaseStudyJEE.ear"
basedir="${dist}" update="yes">
</jar>
</target>
<!-- Deploy the ear. Copy the ear of the JBoss deployment directory -->
<target name="deployear" depends="ear">
<copy file="${dist}/PracticalCaseStudyJEE.ear" todir="${deploy}"/>
</target>
<!-- Clean the build directory -->
<target name="clean">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>