Split Install Deployment

Version 3.1 by Kieran Kelleher on 2007/08/02 09:53

The Simple Way

One simple change to your build.xml: Simply add the wsDestDir property to the woapplication task in your project's build.xml as shown below. As stated by the documentation, presence of that parameter triggers a split install and thus creates an additional woa bundle for the webserver resources.


<woapplication name="${project.name}"  stdFrameworks="false"
                                           destDir="${dest.dir}"
                                           customInfoPListContent="${customInfoPListContent}"
                                           principalClass="${principalClass}"
                                           webXML="${webXML}"
                                           webXML_CustomContent="${webXML_CustomContent}"
                                           wsDestDir="/Library/WebServer/Documents/">

A Better Way

So that both Install and ant build into project dist (build.xml > Run As/Ant Build) provides a split install, make the following 4 1-line changes to your build.xml file as shown in snippet below:

setProps target : add wsinstall.dir property
init.install target : add wsdest.dir property
init.build target :  add wsdest.dir property
woapplication task : add wsDestDir property


<!-- property determination  -->
   <target name="setProps">
       <property file="${user.home}${file.separator}build.properties"/>
       <property file="build.properties"/>
       <property file="${user.home}${file.separator}Library${file.separator}wobuild.properties"/>
       <condition property="wo.properties.check.failed">
           <not>
               <and>
                   <isset property="wo.wosystemroot"/>
                   <isset property="wo.wolocalroot"/>
               </and>
           </not>
       </condition>
       <fail message="Could not find ${user.home}${file.separator}Library${file.separator}wobuild.properties." if="wo.properties.check.failed"/>
       <property name="install.dir" value="${wo.wolocalroot}/Library/WebObjects/Applications"/>
       <property name="wsinstall.dir" value="${wo.wolocalroot}/Library/WebServer/Documents"/>
   </target>

   <!-- basic initializations  -->
   <target name="init.install">
       <tstamp/>
       <property name="dest.dir" value="${install.dir}"/>
       <property name="wsdest.dir" value="${wsinstall.dir}"/>
   </target>

   <target name="init.build">
       <tstamp/>
       <property name="dest.dir" value="dist"/>
       <property name="wsdest.dir" value="dist/wsdocroot"/>
   </target>

   <!-- woproject tasks -->
   <target name="build.woapp">

       <taskdef name="woapplication" classname="org.objectstyle.woproject.ant.WOApplication">
       </taskdef>

       <!-- add webXML="true" to generate a web.xml file -->
       <woapplication name="${project.name}"  stdFrameworks="false"
                                           destDir="${dest.dir}"
                                           customInfoPListContent="${customInfoPListContent}"
                                           principalClass="${principalClass}"
                                           webXML="${webXML}"
                                           webXML_CustomContent="${webXML_CustomContent}"
                                           wsDestDir="${wsdest.dir}">