src/build.xml
changeset 9978 c7ebe8961ccb
parent 9537 636e4eea8441
child 10243 8116aea8f167
--- a/src/build.xml	Thu Jan 20 11:31:26 2011 +0100
+++ b/src/build.xml	Thu Jan 20 12:06:03 2011 +0100
@@ -847,7 +847,12 @@
     </java>
   </target>
 
-  <target name="copy.files" if="mode.class">
+  <!-- Note (see issue 15709 for details):
+       orphan jarfiles are not deleted from the webapp as deployed in tomcat when
+       this rebuild is running inside the rebuild UI (started from MMC). See also the related
+       copy.files.jarsync(.do) task which does this deletion between tomcat stop & start
+   -->
+  <target name="copy.files" depends="copy.files.jarsync.notinrebuildui" if="mode.class">
     <mkdir dir="${jakarta.base}/webapps/${context.name}" />
     <sync todir="${jakarta.base}/webapps/${context.name}">
       <preserveintarget>
@@ -865,6 +870,19 @@
     </copy>
   </target>
 
+  <target name="copy.files.jarsync.notinrebuildui" unless="runningInRebuildUI">
+    <antcall target="copy.files.jarsync.do"/>
+  </target>
+
+  <!-- sync jar files from WebContent -> deployed webapp & delete orphan jars from webapp
+       as delete orphan is excluded from normal copy.files task -->
+  <target name="copy.files.jarsync.do" if="mode.class">
+    <mkdir dir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib"/>
+    <sync todir="${jakarta.base}/webapps/${context.name}/WEB-INF/lib">
+      <fileset dir="${base.context}/WEB-INF/lib" />
+    </sync>
+  </target>
+
   <target name="compile.development" depends="generate.entities, compile, copy.files">
   </target>