root/trunk/build/platforms/jbossWar.xml

Revision 2719 (checked in by douglm, 3 years ago)

Update the activemq configuration from files in the config directory.

Add feeder app to build

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         <antcall target="copyLibs" inheritRefs="true" />
53       </then>
54       <else>
55         <!-- Preserve extra jars for later -->
56         <copy todir="${org.bedework.temp.ear.extrajars.dir}" >
57           <fileset dir="${org.bedework.temp.extrajars.dir}" />
58         </copy>
59       </else>
60     </if>
61   </target>
62  
63   <!-- ================================================================
64        Deploy war
65        ================================================================ -->
66
67   <target name="deployWar">
68     <if>
69       <not>
70         <isset property="org.bedework.global.build.ear" />
71       </not>
72       <then>
73         <echo message="***************************************************************" />
74         <echo message="Deploying standalone app ${app.war.file} into ${org.bedework.appserver.dir}/${propval.app.deploy.dir}" />
75         <echo message="***************************************************************" />
76
77         <!-- copy the war file. -->
78         <copy todir="${org.bedework.appserver.dir}/${propval.app.deploy.dir}" file="${app.war.file}"
79               overwrite="yes" />
80
81         <!-- Delete expanded version -->
82         <delete dir="${org.bedework.appserver.dir}/${propval.app.deploy.dir}/${propval.app.war.name}" />
83       </then>
84     </if>
85   </target>
86    
87   <!-- ================================================================
88        Deploy ear
89        ================================================================ -->
90
91   <target name="deployEar">
92     <!-- Common library in ear file -->
93     <property name="app.dest.lib"
94               location="${org.bedework.ear.dir}" />
95     <antcall target="copyLibs" inheritRefs="true" />
96
97         <!-- And the extra jars we preserved -->
98     <copy todir="${app.dest.lib}" >
99       <fileset dir="${org.bedework.temp.ear.extrajars.dir}" />
100     </copy>
101        
102     <echo message="***************************************************************" />
103     <echo message="Building ear file for jboss deployment" />
104     <echo message="***************************************************************" />
105
106     <jar jarfile="${org.bedework.ear.properties.jar}">
107       <fileset dir="${org.bedework.ear.properties.dir}"/>
108     </jar>
109
110     <path id="app.xml.cp">
111       <pathelement location="${org.bedework.deployutil.jar}"/>
112     </path>
113
114     <taskdef name="applicationXml"
115              classname="org.bedework.deployment.ApplicationXmlTask">
116       <classpath refid="app.xml.cp"/>
117     </taskdef>
118
119     <echo message="outFile=${org.bedework.ear.dir}/META-INF/application.xml
120                     warDir=${org.bedework.temp.dir}/wars
121                     contexts=${org.bedework.global.context.roots}" />
122
123     <applicationXml displayName="Bedework calendar suite"
124                     outFile="${org.bedework.ear.dir}/META-INF/application.xml"
125                     warDir="${org.bedework.temp.dir}/wars"
126                     contexts="${org.bedework.global.context.roots}">
127       <fileset dir="${org.bedework.ear.dir}">
128         <include name="*.jar"/>
129       </fileset>
130     </applicationXml>
131        
132     <echo file="${org.bedework.ear.dir}/META-INF/jboss-app.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
133 <jboss-app>
134    <loader-repository>
135      org.bedework:archive=@EAR_NAME@
136      <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
137    </loader-repository>
138 </jboss-app>
139 ]]></echo>
140        
141     <replace file="${org.bedework.ear.dir}/META-INF/jboss-app.xml"
142                token="@EAR_NAME@"
143                value="${app.ear.file.name}"/>
144            
145     <manifest file="${org.bedework.ear.dir}/META-INF/MANIFEST.MF" />
146
147     <if>
148       <equals arg1="${org.bedework.global.ear.wars.zipped}"
149               arg2="yes" />
150       <then>
151         <copy toDir="${org.bedework.ear.dir}">
152           <fileset dir="${dist.home}"
153                    includes="*.war" />
154         </copy>
155       </then>
156       <else>
157         <copy toDir="${org.bedework.ear.dir}">
158           <fileset dir="${org.bedework.temp.wars.home}"/>
159         </copy>
160       </else>
161     </if>
162
163     <if>
164       <equals arg1="${org.bedework.global.ear.zipped}"
165               arg2="yes" />
166       <then>
167          <zip destfile="${org.bedework.ear.file}"
168              basedir="${org.bedework.ear.dir}"/>
169       </then>
170     </if>
171
172     <!-- copy the ear - at the moment copy the uncompressed. -->
173
174     <if>
175       <isset property="org.bedework.appserver.deploy.dir" />
176       <then>
177         <delete dir="${org.bedework.appserver.deploy.dir}/${app.ear.file.name}" />
178         <mkdir dir="${org.bedework.appserver.deploy.dir}/${app.ear.file.name}" />
179         <copy todir="${org.bedework.appserver.deploy.dir}/${app.ear.file.name}">
180           <fileset dir="${org.bedework.ear.dir}"/>
181         </copy>
182
183         <!-- If requested we also copy in the activemq configuration. -->
184
185         <if>
186           <istrue value="${org.bedework.global.copy.activemq.config}" />
187           <then>
188             <copy file="${org.bedework.config.home}/activemq-ra.xml"
189                     tofile="${org.bedework.global.activemq.dir}/META-INF/ra.xml"
190                   overwrite="yes" />
191             <copy file="${org.bedework.config.home}/activemq-broker-config.xml"
192                   tofile="${org.bedework.global.activemq.dir}/broker-config.xml"
193                   overwrite="yes" />
194             <copy file="${org.bedework.config.home}/activemq-jms-ds.xml"
195                   tofile="${org.bedework.appserver.deploy.dir}/activemq-jms-ds.xml"
196                   overwrite="yes" />
197           </then>
198         </if>
199       </then>
200     </if>
201   </target>
202  
203   <!-- ================================================================
204        Private target to copy libraries
205        ================================================================ -->
206
207   <target name="copyLibs">
208     <!-- hibernate jars -->
209     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.antlr}" />
210     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.asm-attrs}" />
211     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.asm}" />
212     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.cglib}" />
213     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.dom4j}" />
214     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ehcache}" />
215     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.hibernate}" />
216     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.javassist}" />
217     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jta}" />
218     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.slf4j-api}" />
219     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.slf4j-log4j12}" />
220
221     <if>
222       <isset property="org.bedework.build.caldav.google" />
223       <then>
224         <copy todir="${app.dest.lib}">
225           <fileset dir="${google.dir}">
226             <include name="*.jar"/>
227           </fileset>
228         </copy>
229       </then>
230     </if>
231
232     <!-- ===============================================================
233          Any jar files required
234          =============================================================== -->
235
236     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-annotations}" />
237     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.rpiaccess}" />
238     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.rpiutil}" />
239     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-davio}" />
240     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-apiutil}" />
241     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calcore}" />
242     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calcorei}" />
243     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calfacade}" />
244     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvc}" />
245     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvci}" />
246     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-client}" />
247     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-icalendar}" />
248     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-logging}" />
249     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-mail}" />
250     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-sysevents}" />
251     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-appcommon}" />
252
253     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-core}"/>
254     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-misc}"/>
255     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ical4j}"/>
256     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-codec}"/>
257     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-collections}"/>
258     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-httpclient}"/>
259     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-lang}"/>
260     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-ssl}"/>
261
262     <!-- Mail related stuff -->
263     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.activation}" />
264     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.dsn}" />
265     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.imap}" />
266     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.mailapi}" />
267     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.pop3}" />
268     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.smtp}" />
269
270     <!-- any extra files-->
271     <copy todir="${app.dest.lib}" >
272       <fileset dir="${org.bedework.temp.extrajars.dir}" />
273     </copy>
274
275         <!-- Add the struts stuff -->
276     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.serializer}"/>
277     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.xalan}"/>
278     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.struts}"/>
279
280     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-beanutils}"/>
281     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-digester}"/>
282     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-fileupload}"/>
283     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-validator}"/>
284     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jakarta-oro}"/>
285     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jstl}"/>
286     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jstl-standard}"/>
287   </target>
288 </project>
Note: See TracBrowser for help on using the browser.