root/trunk/build/buildwar.xml

Revision 1935 (checked in by douglm, 5 years ago)

Further changes to the build.

Delete (most of) the jar files from the lib directory - we are downloading them from bedework.org at build time.

Use a macro to load the deployment properties adn define some deployment proeprties based on the run time options.

Line 
1 <?xml version="1.0"?>
2
3 <!-- ===================================================================
4      This file is called by other build files to create web applications.
5
6      It is assumed that no changes will be made to this file. It should be
7      possible to make all changes needed by modifying the configuration
8      properties or a bedework.build.proeprties file
9
10      An unwrapped web application will be built in the temp directory
11      and a war and ear file will be left in the dist directory.
12
13      Properties which must be defined on entry, apart from those described
14      in the main build file are:
15     app.root.dir       Location of the root directory for the apps
16     app.sou.dir        Location of the application skeleton,
17     app.name           Name of the application. This wil be used to determine
18                        the name of the file containing the rest of the
19                        application properties, the directory we build in
20                        and the name of war and ear files.
21     cal.j2ee           Defined if this is a j2ee application
22     cal.j2ee.jboss     Defined if this is a jboss application
23     cal.strutsapp      Defined if this is a struts application
24      These should be defined in the build properties for the application.
25
26      It is possible to define any of the app.dest properties below to override
27      the location of destination files.
28
29      In the directory
30         ${apps.sou.dir}
31      we expect an application skeleton formatted like a web-application
32      For the purposes of this build it should contain a
33      structure like
34               war - docs    (contains jsp and html for this app)
35                     WEB-INF - struts-config.xml
36                               web.xml
37                               jboss-web.xml (for jboss only)
38
39      Authors: Mike Douglass
40      =================================================================== -->
41
42 <project name="bedework.buildwar" default="build" >
43   <import file="${build.dir}/buildfilters.xml" />
44
45   <target name="init" depends="init.common,init.j2ee,init.standalone" />
46
47   <target name="init.common">
48     <!-- Destinations - where we build an unwrapped war -->
49     <property name="app.dest.war"
50               location="${org.bedework.temp.wars.home}/${propval.app.war.name}.war" />
51     <property name="app.dest.docs"
52               location="${app.dest.war}/docs" />
53     <property name="app.dest.webinf"
54               location="${app.dest.war}/WEB-INF" />
55     <property name="app.dest.metainf"
56               location="${app.dest.war}/META-INF" />
57     <property name="app.dest.classes"
58               location="${app.dest.webinf}/classes" />
59     <property name="app.dest.properties"
60               location="${app.dest.classes}/properties/calendar" />
61
62     <!--temp web.xml location  -->
63     <property name="app.temp.web.xml"
64               location="${app.dest.webinf}/tempweb.xml" />
65
66     <!--final web.xml location  -->
67     <property name="app.dest.web.xml"
68               location="${app.dest.webinf}/web.xml" />
69
70     <property name="app.war.file"
71               location="${dist.home}/${propval.app.war.name}.war" />
72
73     <!-- default web.xml -->
74     <property name="propval.app.web.xml"
75               value="war/WEB-INF/web.xml" />
76
77               <!--
78     <property name="app.web.xml"
79               location="${propval.app.web.xml}" />
80               -->
81     <resolveFile name="app.web.xml"
82                  file="${propval.app.web.xml}"
83                  base="${app.sou.dir}"/>
84
85     <property name="app.sou.properties"
86               location="${app.sou.dir}/war/WEB-INF/classes/servlet.properties" />
87   </target>
88
89   <target name="init.standalone" if="org.bedework.global.build.standalone.app">
90
91     <property name="app.dest.lib"
92               location="${app.dest.webinf}/lib" />
93   </target>
94
95   <target name="init.j2ee" if="org.bedework.global.j2ee.platform">
96     <property name="app.dest.lib"
97               location="${org.bedework.temp.dir}/earlib" />
98   </target>
99
100   <target name="build" depends="init">
101     <echo message="**************************************************" />
102     <echo message=" * Building war ${propval.app.war.name}"/>
103     <echo message="**************************************************" />
104
105     <delete dir="${app.dest.war}" />
106
107     <!-- Add modifed login pages -->
108     <copy todir="${app.dest.docs}/login" failonerror="false" >
109       <fileset dir="${org.bedework.common.resources}/login" />
110       <filterset>
111         <filter token="DISPLAY-NAME" value="${propval.app.display.name}"/>
112       </filterset>
113     </copy>
114
115     <!-- ===============================================================
116          We copy 3 sets of properties.
117
118          First (for struts) are the servlet properties which ends up as
119               classes/servlet.properties
120          Next we copy in a set of generic property files and then with
121          overwrite we copy in a set of base specific files.
122
123          All are updated with new values.
124          =============================================================== -->
125
126     <available file="${app.sou.dir}/properties" type="dir"
127                property="org.bedework.properties.dir.exists" />
128
129     <available file="${app.sou.properties}" type="file"
130                property="org.bedework.servlet.properties.exists" />
131
132     <available file="${app.sou.dir}/war/docs" type="dir"
133                property="org.bedework.war.docs.exists" />
134
135     <antcall target="copy.properties" inheritRefs="true" />
136     <antcall target="copy.servlet.properties" inheritRefs="true" />
137     <antcall target="copy.war.docs" inheritRefs="true" />
138
139     <!-- Create the runtime options file -->
140     <mkdir dir="${app.dest.properties}" />
141
142     <copy tofile="${app.dest.properties}/options.xml"
143           file="${org.bedework.config.options}" >
144       <filterset>
145         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
146       </filterset>
147       <filterset refid="property.filters" />
148     </copy>
149
150     <!-- Make a temp copy of the web.xml file -->
151     <copy tofile="${app.temp.web.xml}" file="${app.web.xml}"
152           overwrite="yes" />
153
154     <antcall target="struts-stuff" inheritRefs="true" />
155
156     <!-- Filter the temp copy of the web.xml file -->
157     <copy tofile="${app.dest.web.xml}"
158           file="${app.temp.web.xml}"
159           overwrite="yes" >
160       <filterset>
161         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
162       </filterset>
163       <filterset refid="property.filters" />
164     </copy>
165
166     <delete file="${app.temp.web.xml}" />
167
168     <!-- Add the contex root to the file. Note that newline is required -->
169     <echo file="${org.bedework.global.context.roots}" append="yes">
170 ${propval.app.war.name}.context=${propval.app.context.root}
171     </echo>
172
173     <!-- ===============================================================
174          Add hibernate jars and property files from calendar api.
175          =============================================================== -->
176
177     <copy todir="${app.dest.classes}">
178       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/properties" />
179       <filterset refid="property.filters" />
180     </copy>
181
182     <copy todir="${app.dest.classes}">
183       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/hbms" />
184       <filterset refid="property.filters" />
185     </copy>
186
187     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.antlr}" />
188     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.asm-attrs}" />
189     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.asm}" />
190     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.cglib}" />
191     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.dom4j}" />
192     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ehcache}" />
193     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.hibernate}" />
194     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jgroups}" />
195     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jta}" />
196
197     <antcall target="jboss-stuff" inheritRefs="true" />
198     <antcall target="bexchange-stuff" inheritRefs="true" />
199     <antcall target="domino-stuff" inheritRefs="true" />
200     <antcall target="google-stuff" inheritRefs="true" />
201
202     <!-- ===============================================================
203          Any jar files required
204          =============================================================== -->
205
206     <echo message="+++++++++++  bw-logging at ${org.bedework.appjar.bw-logging}" />
207     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-annotations}" />
208     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.rpiaccess}" />
209     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.rpiutil}" />
210     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-davio}" />
211     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-apiutil}" />
212     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calcore}" />
213     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calcorei}" />
214     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calenv}" />
215     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calfacade}" />
216     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvc}" />
217     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvci}" />
218     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-client}" />
219     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-icalendar}" />
220     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-logging}" />
221     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-mail}" />
222     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-appcommon}" />
223
224      <!-- any extra files-->
225     <copy todir="${app.dest.lib}" >
226       <fileset dir="${org.bedework.temp.extrajars.dir}" />
227     </copy>
228
229     <!-- Some more standard libs -->
230     <if>
231       <not>
232         <isset property="org.bedework.build.for.jboss"/>
233       </not>
234       <then>
235         <copy todir="${app.dest.lib}" file="${org.bedework.appjar.log4j}"/>
236       </then>
237     </if>
238     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-core}"/>
239     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-misc}"/>
240     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ical4j}"/>
241     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-codec}"/>
242     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-collections}"/>
243     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-httpclient}"/>
244     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-lang}"/>
245     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-ssl}"/>
246
247     <!-- Mail related stuff -->
248     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.activation}" />
249     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.dsn}" />
250     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.imap}" />
251     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.mailapi}" />
252     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.pop3}" />
253     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.smtp}" />
254
255     <!-- add the jdbcdriver if defined
256          Disable this - shouldn't be adding jdbc drivers to the war file
257     <if>
258       <isset property="app.jdbcdriver.jar"/>
259       <then>
260         <copy todir="${app.dest.lib}" file="${app.jdbcdriver.jar}"/>
261       </then>
262     </if>
263      -->
264
265     <!-- tomcat -->
266     <antcall target="add.tomcat" inheritRefs="true" />
267
268     <!-- build the war file -->
269     <mkdir dir="${dist.home}" />
270     <delete file="${app.war.file}" />
271
272     <war warfile="${app.war.file}"
273          webxml="${app.dest.web.xml}"
274          basedir="${app.dest.war}"
275          excludes="WEB-INF/web.xml" />
276   </target>
277
278   <target name="add.tomcat" if="org.bedework.global.deploy.on.tomcat">
279     <property name="propval.app.tomcat.context.xml"
280               location="${app.sou.dir}/war/META-INF/context.xml" />
281     <resolveFile name="app.tomcat.context.xml"
282                  file="${propval.app.tomcat.context.xml}"
283                  base="${app.sou.dir}"/>
284
285     <copy tofile="${app.dest.metainf}/context.xml"
286           file="${app.tomcat.context.xml}"
287           overwrite="yes" >
288       <filterset refid="property.filters" />
289     </copy>
290   </target>
291
292   <target name="copy.properties" if="org.bedework.properties.dir.exists">
293     <!-- ===============================================================
294          Any property files we need for configuration, other than the
295          standard struts file, should be in the "${app.sou.dir}/properties
296          directory. They will be copied into the appropriate place for the
297          war and transformed by the above filter.
298          =============================================================== -->
299     <copy todir="${app.dest.properties}" overwrite="yes" >
300       <fileset dir="${app.sou.dir}/properties"
301                includes="*.properties"/>
302       <filterset refid="property.filters" />
303     </copy>
304   </target>
305
306   <target name="copy.servlet.properties">
307     <copy todir="${app.dest.classes}">
308       <fileset dir="${app.sou.dir}/war/WEB-INF/classes"
309                includes="*"/>
310       <filterset refid="property.filters" />
311     </copy>
312   </target>
313
314   <target name="copy.war.docs" if="org.bedework.war.docs.exists">
315     <copy todir="${app.dest.docs}">
316       <fileset dir="${app.sou.dir}/war/docs" />
317     </copy>
318   </target>
319
320   <target name="bexchange-stuff" if="org.bedework.build.caldav.bexchange">
321     <copy tofile="${app.dest.properties}/timezones.xml"
322           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
323   </target>
324
325   <target name="domino-stuff" if="org.bedework.build.caldav.domino">
326     <copy tofile="${app.dest.properties}/timezones.xml"
327           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
328   </target>
329
330   <target name="google-stuff" if="org.bedework.build.caldav.google">
331     <copy todir="${app.dest.lib}">
332       <fileset dir="${google.dir}">
333         <include name="*.jar"/>
334       </fileset>
335     </copy>
336
337     <copy tofile="${app.dest.properties}/timezones.xml"
338           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
339   </target>
340
341   <!-- =================================================================
342        If this is a struts app the following gets executed.
343        We create an updated struts-config.xml file and add some jars.
344        ================================================================= -->
345
346   <target name="struts-stuff" if="org.bedework.strutsapp">
347     <!-- Copy a dummy startup file into the war. -->
348     <copy todir="${app.dest.war}">
349       <fileset dir="${app.sou.dir}/war/" includes="setup.do" />
350     </copy>
351
352     <copy todir="${app.dest.webinf}"
353           file="${app.sou.dir}/war/WEB-INF/struts-config.xml"/>
354
355     <mkdir  dir="${app.dest.webinf}/tlds"/>
356     <copy todir="${app.dest.webinf}/tlds" >
357       <fileset dir="${org.bedework.struts.tlds}">
358         <include name="*"/>
359       </fileset>
360     </copy>
361
362     <if>
363       <not>
364         <isset property="xalan.in.tomcat.common.endorsed" />
365       </not>
366       <then>
367         <copy todir="${app.dest.lib}" file="${org.bedework.appjar.xalan}"/>
368       </then>
369     </if>
370
371     <if>
372       <isset property="org.bedework.global.portal.platform" />
373       <then>
374         <!-- Add common portlet files -->
375
376         <copy todir="${app.dest.lib}"
377               file="${org.bedework.appjar.portals-bridges-common}"/>
378         <copy todir="${app.dest.lib}"
379               file="${org.bedework.appjar.portals-bridges-struts-1.2.7}"/>
380
381         <!-- Use generic bedework portlet tld -->
382         <copy todir="${app.dest.webinf}/tlds"
383               overwrite="yes"
384               failonerror="no" >
385           <fileset dir="${app.root.dir}/resources/portlet" >
386             <include name="*.tld"/>
387           </fileset>
388         </copy>
389
390         <copy todir="${app.dest.webinf}"
391               file="${org.bedework.deploy.type.dir}/portlet/struts-portlet-config.xml"
392               overwrite="yes"
393               failonerror="no" />
394
395         <copy todir="${app.dest.webinf}"
396               file="${org.bedework.deploy.type.dir}/portlet/portlet.xml"
397               overwrite="yes"
398               failonerror="no" >
399           <filterset refid="property.filters" />
400         </copy>
401
402         <!-- Add the portal bridge controller def -->
403         <replace file="${app.dest.webinf}/struts-config.xml">
404           <replacetoken><![CDATA[<!-- portlet controller def here -->]]></replacetoken>
405           <replacevalue><![CDATA[<controller pagePattern="$M$P" inputForward="true"
406                   processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>]]>
407           </replacevalue>
408         </replace>
409
410         <antcall target="add.jetspeed2" inheritRefs="true" />
411         <antcall target="add.uportal2" inheritRefs="true" />
412         <antcall target="add.liferay4" inheritRefs="true" />
413         <antcall target="add.liferay5" inheritRefs="true" />
414       </then>
415     </if>
416
417     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.struts}"/>
418
419     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.antlr}"/>
420     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-beanutils}"/>
421     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-digester}"/>
422     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-fileupload}"/>
423     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-logging}"/>
424     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-validator}"/>
425     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jakarta-oro}"/>
426     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jstl}"/>
427     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jstl-standard}"/>
428   </target>
429
430   <!-- =================================================================
431        Jetspeed 2 modifications
432        ================================================================= -->
433
434   <target name="add.jetspeed2" if="org.bedework.build.for.jetspeed2" >
435     <copy todir="${app.dest.webinf}/tlds" >
436       <fileset dir="${org.bedework.default.lib}/${jetspeed2.jars.dir}/portals-bridges-struts">
437         <include name="*.tld"/>
438       </fileset>
439     </copy>
440   </target>
441
442   <!-- =================================================================
443        Uportal 2 modifications
444        ================================================================= -->
445
446   <target name="add.uportal2" if="org.bedework.build.for.uportal2" >
447     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.uportal}"/>
448
449     <!-- Add the portlet servlet mapping -->
450     <replace file="${app.temp.web.xml}">
451       <replacetoken><![CDATA[<!-- portlet servlet mapping here -->]]></replacetoken>
452       <replacevalue><![CDATA[<servlet-mapping>
453     <servlet-name>@PORTLET-NAME@</servlet-name>
454     <url-pattern>/@PORTLET-NAME@/*</url-pattern>
455   </servlet-mapping>]]>
456       </replacevalue>
457     </replace>
458
459   </target>
460
461   <!-- =================================================================
462        Liferay 4 modifications
463        ================================================================= -->
464
465   <target name="add.liferay4" if="org.bedework.build.for.liferay4" >
466    <!-- Add liferay config files -->
467     <copy todir="${app.dest.webinf}" >
468       <fileset dir="${app.sou.dir}/war/WEB-INF" >
469         <include name="liferay*"/>
470       </fileset>
471       <filterset refid="property.filters" />
472     </copy>
473
474     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay}"/>
475     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay.util-bridges}"/>
476     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay.util-java}"/>
477
478     <!-- Add the context params -->
479     <replace file="${app.temp.web.xml}">
480       <replacetoken><![CDATA[<!-- add context params here -->]]></replacetoken>
481       <replacevalue><![CDATA[<!-- add context params here -->
482
483   <context-param>
484     <param-name>company_id</param-name>
485     <param-value>@LIFERAY-COMPANY-ID@</param-value>
486   </context-param>]]>
487       </replacevalue>
488     </replace>
489
490     <!-- Add the portal listener -->
491     <replace file="${app.temp.web.xml}">
492       <replacetoken><![CDATA[<!-- add listeners here -->]]></replacetoken>
493       <replacevalue><![CDATA[<!-- add listeners here -->
494
495   <listener>
496     <listener-class>
497       @PORTAL-SERVLET-CONTEXT-LISTENER@
498     </listener-class>
499   </listener>]]>
500       </replacevalue>
501     </replace>
502
503     <!-- Add the portlet servlet definition -->
504     <replace file="${app.temp.web.xml}">
505       <replacetoken><![CDATA[<!-- add servlet definitions here -->]]></replacetoken>
506       <replacevalue><![CDATA[<!-- add servlet definitions here -->
507
508   <!-- Servlet definition for portlet use. -->
509   <servlet>
510     <servlet-name>@PORTLET-NAME@</servlet-name>
511     <display-name>@PORTLET-NAME@ Wrapper</display-name>
512     <servlet-class>@PORTLET-SERVLET-CLASS@</servlet-class>
513     <init-param>
514       <param-name>portlet-class</param-name>
515       <param-value>@PORTLET-CLASS@</param-value>
516     </init-param>
517     <init-param>
518       <param-name>portlet-guid</param-name>
519       <param-value>@CONTEXT-ROOT@.@PORTLET-NAME@</param-value>
520     </init-param>
521   </servlet>]]>
522       </replacevalue>
523     </replace>
524
525     <!-- Add the portlet servlet mapping -->
526     <replace file="${app.temp.web.xml}">
527       <replacetoken><![CDATA[<!-- add servlet mappings here -->]]></replacetoken>
528       <replacevalue><![CDATA[<!-- add servlet mappings here -->
529
530   <servlet-mapping>
531     <servlet-name>@PORTLET-NAME@</servlet-name>
532     <url-pattern>/@PORTLET-NAME@/*</url-pattern>
533   </servlet-mapping>]]>
534       </replacevalue>
535     </replace>
536   </target>
537
538   <!-- =================================================================
539        Liferay 5 modifications
540        ================================================================= -->
541
542   <target name="add.liferay5" if="org.bedework.build.for.liferay5" >
543    <!-- Add liferay config files -->
544     <copy todir="${app.dest.webinf}" >
545       <fileset dir="${app.sou.dir}/war/WEB-INF" >
546         <include name="liferay*"/>
547       </fileset>
548       <filterset refid="property.filters" />
549     </copy>
550
551     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay.util-taglib}"/>
552     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay.util-bridges}"/>
553     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay.util-java}"/>
554
555     <!-- Add the context params -->
556     <replace file="${app.temp.web.xml}">
557       <replacetoken><![CDATA[<!-- add context params here -->]]></replacetoken>
558       <replacevalue><![CDATA[<!-- add context params here -->
559
560   <context-param>
561     <param-name>company_id</param-name>
562     <param-value>@LIFERAY-COMPANY-ID@</param-value>
563   </context-param>]]>
564       </replacevalue>
565     </replace>
566
567     <!-- Add the portal listener -->
568     <replace file="${app.temp.web.xml}">
569       <replacetoken><![CDATA[<!-- add listeners here -->]]></replacetoken>
570       <replacevalue><![CDATA[<!-- add listeners here -->
571
572   <listener>
573     <listener-class>
574       @PORTAL-SERVLET-CONTEXT-LISTENER@
575     </listener-class>
576   </listener>]]>
577       </replacevalue>
578     </replace>
579
580     <!-- Add the portlet servlet definition -->
581     <replace file="${app.temp.web.xml}">
582       <replacetoken><![CDATA[<!-- add servlet definitions here -->]]></replacetoken>
583       <replacevalue><![CDATA[<!-- add servlet definitions here -->
584
585   <!-- Servlet definition for portlet use. -->
586   <servlet>
587     <servlet-name>@PORTLET-NAME@</servlet-name>
588     <display-name>@PORTLET-NAME@ Wrapper</display-name>
589     <servlet-class>@PORTLET-SERVLET-CLASS@</servlet-class>
590     <init-param>
591       <param-name>portlet-class</param-name>
592       <param-value>@PORTLET-CLASS@</param-value>
593     </init-param>
594     <init-param>
595       <param-name>portlet-guid</param-name>
596       <param-value>@CONTEXT-ROOT@.@PORTLET-NAME@</param-value>
597     </init-param>
598   </servlet>]]>
599       </replacevalue>
600     </replace>
601
602     <!-- Add the portlet servlet mapping -->
603     <replace file="${app.temp.web.xml}">
604       <replacetoken><![CDATA[<!-- add servlet mappings here -->]]></replacetoken>
605       <replacevalue><![CDATA[<!-- add servlet mappings here -->
606
607   <servlet-mapping>
608     <servlet-name>@PORTLET-NAME@</servlet-name>
609     <url-pattern>/@PORTLET-NAME@/*</url-pattern>
610   </servlet-mapping>]]>
611       </replacevalue>
612     </replace>
613   </target>
614
615   <!-- =================================================================
616        If this is a j2ee app the following gets executed.
617        We create an uodated jboss-web.xml file (for jboss) and a ear
618        ================================================================= -->
619
620   <target name="jboss-stuff" if="org.bedework.build.for.jboss">
621     <copy todir="${app.dest.webinf}"
622           file="${app.sou.dir}/war/WEB-INF/jboss-web.xml">
623       <filterset refid="property.filters" />
624     </copy>
625
626     <if>
627       <isset property="propval.app.virtual.host" />
628       <then>
629         <replace file="${app.dest.webinf}/jboss-web.xml">
630           <replacetoken><![CDATA[<!-- Virtual host -->]]></replacetoken>
631           <replacevalue><![CDATA[<virtual-host>@VIRTUAL-HOST@</virtual-host>
632           ]]>
633           </replacevalue>
634         </replace>
635         <replace file="${app.dest.webinf}/jboss-web.xml">
636           <replacefilter token="@VIRTUAL-HOST@" value="${propval.app.virtual.host}"/>
637         </replace>
638       </then>
639     </if>
640   </target>
641
642   <target name="build.ear" if="cal.j2ee">
643     <ant antfile="${buildear}"
644          inheritRefs="true" target="build" />
645   </target>
646 </project>
Note: See TracBrowser for help on using the browser.