root/trunk/build/platforms/jbossWar.xml

Revision 3148 (checked in by douglm, 2 years ago)

Small change to incorporate bedework services in ear file. Should reduce startup time and build/deploy time as well as memory usage

Line 
1 <?xml version="1.0"?>
2
3 <!-- ===================================================================
4      This file is imported by buildwar.xml and adds the targets
5      which will be invoked by the buildwar targets.
6         addLibs: add libraries for this platform
7         doPlatform - misc stuff
8         deployWar: deploy the war to the server
9         deployEar: deploy the ear to the server
10      =================================================================== -->
11
12 <project name="bedework.platformWar" default="doPlatform" >
13   <target name="doPlatform" >
14     <!-- ===============================================================
15          We create an updated jboss-web.xml file (for jboss) and a ear
16          =============================================================== -->
17
18     <copy todir="${app.dest.webinf}"
19           file="${app.sou.dir}/war/WEB-INF/jboss-web.xml">
20       <filterset refid="property.filters" />
21     </copy>
22
23     <if>
24       <isset property="propval.app.virtual.host" />
25       <then>
26         <replace file="${app.dest.webinf}/jboss-web.xml">
27           <replacetoken><![CDATA[<!-- Virtual host -->]]></replacetoken>
28           <replacevalue><![CDATA[<virtual-host>@VIRTUAL-HOST@</virtual-host>
29           ]]>
30           </replacevalue>
31         </replace>
32         <replace file="${app.dest.webinf}/jboss-web.xml">
33           <replacefilter token="@VIRTUAL-HOST@" value="${propval.app.virtual.host}"/>
34         </replace>
35       </then>
36     </if>
37   </target>
38  
39   <!-- ================================================================
40        Add libraries
41        ================================================================ -->
42
43   <target name="addLibs">
44     <if>
45       <not>
46         <isset property="org.bedework.global.build.ear" />
47       </not>
48       <then>
49         <!-- Library in war file -->
50         <property name="app.dest.lib"
51                   location="${app.dest.webinf}/lib" />
52         <if>
53           <not>
54             <isset property="propval.app.no.defaultlibs" />
55           </not>
56           <then>
57             <antcall target="copyLibs" inheritRefs="true" />
58           </then>
59         </if>
60       </then>
61       <else>
62         <!-- Preserve extra jars for later -->
63         <copy todir="${org.bedework.temp.ear.extrajars.dir}" >
64           <fileset dir="${org.bedework.temp.extrajars.dir}" />
65         </copy>
66       </else>
67     </if>
68   </target>
69  
70   <!-- ================================================================
71        Deploy war
72        ================================================================ -->
73
74   <target name="deployWar">
75     <if>
76       <not>
77         <isset property="org.bedework.global.build.ear" />
78       </not>
79       <then>
80         <infoMsg message="* =========== Deploying standalone app ${app.war.file} into ${org.bedework.appserver.dir}/${propval.app.deploy.dir}" />
81
82         <!-- copy the war file. -->
83         <copy todir="${org.bedework.appserver.dir}/${propval.app.deploy.dir}" file="${app.war.file}"
84               overwrite="yes" />
85
86         <!-- Delete expanded version -->
87         <delete dir="${org.bedework.appserver.dir}/${propval.app.deploy.dir}/${propval.app.war.name}" />
88       </then>
89     </if>
90   </target>
91    
92   <!-- ================================================================
93        Deploy ear
94        ================================================================ -->
95
96   <target name="deployEar">
97     <if>
98       <equals arg1="${org.bedework.global.ear.zipped}"
99               arg2="yes" />
100       <then>
101         <property name="org.bedework.ear.dir"
102                   location="${org.bedework.temp.dir}/${org.bedework.ear.name}" />
103         <property name="org.bedework.ear.file"
104                   location="${org.bedework.temp.dir}/${org.bedework.ear.name}.ear" />
105       </then>
106       <else>
107         <property name="org.bedework.ear.dir"
108                   location="${org.bedework.temp.dir}/${org.bedework.ear.name}.ear" />
109       </else>
110     </if>
111
112     <delete dir="${org.bedework.ear.dir}" />
113     <mkdir dir="${org.bedework.ear.dir}" />
114
115     <property name="org.bedework.ear.properties.jar"
116               value="${org.bedework.ear.dir}/bw-ear-properties.jar"/>
117
118     <!-- Common library in ear file -->
119     <property name="app.dest.lib"
120               location="${org.bedework.ear.dir}" />
121     <if>
122       <not>
123         <isset property="propval.app.no.defaultlibs" />
124       </not>
125       <then>
126         <antcall target="copyLibs" inheritRefs="true" />
127       </then>
128     </if>
129    
130     <!-- Add any extra jars -->
131     <copy todir="${org.bedework.temp.ear.extrajars.dir}" >
132       <fileset dir="${org.bedework.temp.extrajars.dir}" />
133     </copy>
134
135     <!-- And the extra jars we preserved -->
136     <copy todir="${app.dest.lib}" >
137       <fileset dir="${org.bedework.temp.ear.extrajars.dir}" />
138     </copy>
139        
140     <infoMsg message="* =========== Building ear file ${org.bedework.ear.dir} for jboss deployment" />
141
142     <jar jarfile="${org.bedework.ear.properties.jar}">
143       <fileset dir="${org.bedework.ear.properties.dir}"/>
144     </jar>
145
146     <debugMsg message="outFile=${org.bedework.ear.dir}/META-INF/application.xml
147                         warDir=${org.bedework.temp.dir}/wars
148                         contexts=${org.bedework.global.context.roots}" />
149
150         <mkdir dir="${org.bedework.ear.dir}/META-INF" />
151        
152     <applicationXml displayName="Bedework calendar suite"
153                     outFile="${org.bedework.ear.dir}/META-INF/application.xml"
154                     warDir="${org.bedework.temp.dir}/wars"
155                     contexts="${org.bedework.global.context.roots}">
156       <fileset dir="${org.bedework.ear.dir}">
157         <include name="*.jar"/>
158       </fileset>
159     </applicationXml>
160    
161     <echo file="${org.bedework.ear.dir}/META-INF/jboss-app.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
162 <jboss-app>
163    <loader-repository>
164      org.bedework:archive=@EAR_NAME@
165      <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
166    </loader-repository>
167 </jboss-app>
168 ]]></echo>
169      
170     <replace file="${org.bedework.ear.dir}/META-INF/jboss-app.xml"
171              token="@EAR_NAME@"
172              value="${app.ear.file.name}"/>
173
174     <if>
175       <and>
176         <isset property="ear.meta.dir" />
177         <available file="${ear.meta.dir}" type="dir" />
178       </and>
179       <then>
180         <copy todir="${org.bedework.ear.dir}/META-INF">
181           <fileset dir="${ear.meta.dir}" />
182           <filterset refid="property.filters" />
183         </copy>
184       </then>
185     </if>
186          
187     <manifest file="${org.bedework.ear.dir}/META-INF/MANIFEST.MF" />
188
189     <if>
190       <equals arg1="${org.bedework.global.ear.wars.zipped}"
191               arg2="yes" />
192       <then>
193         <copy toDir="${org.bedework.ear.dir}">
194           <fileset dir="${dist.home}"
195                    includes="*.war" />
196         </copy>
197       </then>
198       <else>
199         <copy toDir="${org.bedework.ear.dir}">
200           <fileset dir="${org.bedework.temp.wars.home}"/>
201         </copy>
202       </else>
203     </if>
204
205     <if>
206       <equals arg1="${org.bedework.global.ear.zipped}"
207               arg2="yes" />
208       <then>
209          <zip destfile="${org.bedework.ear.file}"
210              basedir="${org.bedework.ear.dir}"/>
211       </then>
212     </if>
213
214     <!-- copy the ear - at the moment copy the uncompressed. -->
215
216     <if>
217       <isset property="org.bedework.appserver.deploy.dir" />
218       <then>
219         <delete dir="${org.bedework.appserver.deploy.dir}/${app.ear.file.name}" />
220         <mkdir dir="${org.bedework.appserver.deploy.dir}/${app.ear.file.name}" />
221         <copy todir="${org.bedework.appserver.deploy.dir}/${app.ear.file.name}">
222           <fileset dir="${org.bedework.ear.dir}"/>
223         </copy>
224       </then>
225     </if>
226   </target>
227  
228   <!-- ================================================================
229        Private target to copy libraries
230        ================================================================ -->
231
232   <target name="copyLibs">
233     <!-- hibernate jars -->
234     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.antlr}" />
235     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.asm-attrs}" />
236     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.asm}" />
237     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.cglib}" />
238     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.dom4j}" />
239     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ehcache}" />
240     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.hibernate}" />
241     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.javassist}" />
242     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jta}" />
243     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.slf4j-api}" />
244     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.slf4j-log4j12}" />
245
246     <if>
247       <isset property="org.bedework.build.caldav.google" />
248       <then>
249         <copy todir="${app.dest.lib}">
250           <fileset dir="${google.dir}">
251             <include name="*.jar"/>
252           </fileset>
253         </copy>
254       </then>
255     </if>
256
257     <!-- ===============================================================
258          Any jar files required
259          =============================================================== -->
260
261     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-annotations}" />
262     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.rpiaccess}" />
263     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.rpiutil}" />
264     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-davio}" />
265     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-apiutil}" />
266     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calcore}" />
267     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calcorei}" />
268     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calfacade}" />
269     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvc}" />
270     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvci}" />
271     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-client}" />
272     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-icalendar}" />
273     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-logging}" />
274     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-mail}" />
275     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-sysevents}" />
276     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-appcommon}" />
277
278     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-core}"/>
279     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-misc}"/>
280     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.backport-util-concurrent}"/>
281     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ical4j}"/>
282     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ical4j-vcard}"/>
283     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-codec}"/>
284     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-collections}"/>
285     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-httpclient}"/>
286     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-lang}"/>
287     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-ssl}"/>
288
289     <!-- Mail related stuff -->
290     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.activation}" />
291     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.dsn}" />
292     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.imap}" />
293     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.mailapi}" />
294     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.pop3}" />
295     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.smtp}" />
296
297     <!-- any extra files-->
298     <copy todir="${app.dest.lib}" >
299       <fileset dir="${org.bedework.temp.extrajars.dir}" />
300     </copy>
301
302         <!-- Add the struts stuff -->
303     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.serializer}"/>
304     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.xalan}"/>
305     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.struts}"/>
306
307     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-beanutils}"/>
308     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-digester}"/>
309     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-fileupload}"/>
310     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-validator}"/>
311     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jakarta-oro}"/>
312     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jstl}"/>
313     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jstl-standard}"/>
314   </target>
315 </project>
Note: See TracBrowser for help on using the browser.