Make sure we hot replace the war files so that we can swap the servlet adaptor to the CXF servlet
diff --git a/src/test/resources/jaxrs/cxf.xml b/src/test/resources/jaxrs/cxf.xml
index 9668bc5..9be8eae 100644
--- a/src/test/resources/jaxrs/cxf.xml
+++ b/src/test/resources/jaxrs/cxf.xml
@@ -1,97 +1,111 @@
-
 <project name="CXF package and deploy" default="deploy">
 
-    <!--
-    JAX-RS TCK package target: package JAX-RS TCK test application into web archive
+  <!--
+  JAX-RS TCK package target: package JAX-RS TCK test application into web archive
 
-    resource.classes:  specified in individual test's build.xml,
-                       contains all resource class used in the test
-    app.name:          specified in individual test's build.xml,
-                       is used for web archive name: ${app.name}_web.war
-                       is also used in web application's context root:
-                       ${app.name}_web
-    web.xml:           located in individual test's directory.
-                       Is web application's deployment descriptor.
-    class.dir:         TCK's class directory.  Located at $TS_HOME/classes
-    servlet_adaptor:   specified in $TS_HOME/bin/ts.jte.
-                       Required by JAX-RS specification to run in servlet container,
-                       it is imeplementation specific.
-    appconfig.class:   specified in individual test's build.xml.
-                       Required by JAX-RS spec to list all resources in the test application.
-    -->
+  resource.classes:  specified in individual test's build.xml,
+                     contains all resource class used in the test
+  app.name:          specified in individual test's build.xml,
+                     is used for web archive name: ${app.name}_web.war
+                     is also used in web application's context root:
+                     ${app.name}_web
+  web.xml:           located in individual test's directory.
+                     Is web application's deployment descriptor.
+  class.dir:         TCK's class directory.  Located at $TS_HOME/classes
+  servlet_adaptor:   specified in $TS_HOME/bin/ts.jte.
+                     Required by JAX-RS specification to run in servlet container,
+                     it is imeplementation specific.
+  appconfig.class:   specified in individual test's build.xml.
+                     Required by JAX-RS spec to list all resources in the test application.
+  -->
+
+  <!--
+  JAX-RS TCK deploy target: Deploy JAX-RS web archive
+
+  webapp.dir:  autodeploy directory for web application
+  -->
+  <import file="../../ts.top.import.xml"/>
+
+  <target name="pre.deploy">
+    <fileset id="all.jaxrs.src.dirs" dir="${ts.home}/src" includes="**/web.xml.template"/>
+    <property name="prop.all.jaxrs.src.dirs" refid="all.jaxrs.src.dirs"/>
+    <propertyregex property="all.jaxrs.tests.dir"
+                   input="${prop.all.jaxrs.src.dirs}"
+                   regexp="[\/|\\]web.xml.template"
+                   replace=""
+                   casesensitive="false"/>
+    <!-- It seems the separator can be != path.separator -->
+    <propertyregex property="all.jaxrs.tests.dir.correct.separator"
+                   input="${all.jaxrs.tests.dir}"
+                   regexp=";"
+                   replace="${path.separator}"
+                   casesensitive="false"/>
+    <foreach list="${all.jaxrs.tests.dir.correct.separator}"
+             delimiter="${path.separator}"
+             target="all_action"
+             param="pkg.dir"/>
+  </target>
+
+  <target name="check.web.xml">
+    <available file="${ts.home}/src/${pkg.dir}/web.xml.template" property="exist.web.xml"/>
+  </target>
+
+  <target name="all_action" depends="update_servlet_adaptor,copywar"/>
+
+  <target name="update_servlet_adaptor" depends="check.web.xml" if="exist.web.xml">
+
+    <echo message=">>> Servlet adaptor class ${servlet_adaptor}"/>
 
     <!--
-    JAX-RS TCK deploy target: Deploy JAX-RS web archive
-
-    webapp.dir:  autodeploy directory for web application
+    Create implementation specific web with servlet information
     -->
-    <import file="../../ts.top.import.xml"/>
-    <property name="all.jaxrs.tests.dir"
-              value="com/sun/ts/tests/jaxrs/spec/template,com/sun/ts/tests/jaxrs/spec/exposureTest,com/sun/ts/tests/jaxrs/spec/inheritanceTest,com/sun/ts/tests/jaxrs/spec/returnType,com/sun/ts/tests/jaxrs/ee/rs/deleteTest,com/sun/ts/tests/jaxrs/ee/rs/headTest,com/sun/ts/tests/jaxrs/ee/rs/matrixParamTest,com/sun/ts/tests/jaxrs/ee/rs/queryParamTest,com/sun/ts/tests/jaxrs/ee/rs/cookieParamTest,com/sun/ts/tests/jaxrs/ee/rs/getTest,com/sun/ts/tests/jaxrs/ee/rs/headerParamTest,com/sun/ts/tests/jaxrs/ee/rs/pathParamTest,com/sun/ts/tests/jaxrs/ee/rs/putTest,com/sun/ts/tests/jaxrs/ee/rs_core/headersTest,com/sun/ts/tests/jaxrs/ee/rs_core/responseCSTest,com/sun/ts/tests/jaxrs/ee/rs_core/uriInfoTest"/>
+    <copy file="${ts.home}/src/${pkg.dir}/web.xml.template" verbose="true"
+          tofile="${ts.home}/dist/${pkg.dir}/web.xml.${jaxrs_impl_name}"/>
 
-    <target name="pre.deploy">
-        <foreach list="${all.jaxrs.tests.dir}"
-                 delimiter=","
-                 target="all_action"
-                 param="pkg.dir"/>
-    </target>
+    <replace file="${ts.home}/dist/${pkg.dir}/web.xml.${jaxrs_impl_name}" value="${servlet_adaptor}" summary="yes">
+      <replacetoken>servlet_adaptor</replacetoken>
+    </replace>
 
-    <target name="all_action">
+    <!--
+    Create implementation specfic war files with
+        updated web.xml;
+        servlet class;
+    -->
 
-        <!--
-        Create implementation specific web with servlet information
-        -->
-        <copy file="${ts.home}/src/${pkg.dir}/web.xml.template" tofile="${ts.home}/src/${pkg.dir}/web.xml.${jaxrs_impl_name}" overwrite="true" />
+    <antcall target="updatewar"/>
+  </target>
 
-        <echo message="${servlet_adaptor}"/>
-        <replace file="${ts.home}/src/${pkg.dir}/web.xml.${jaxrs_impl_name}" value="${servlet_adaptor}">
-            <replacetoken>servlet_adaptor</replacetoken>
-        </replace>
+  <target name="get.app.name">
+    <fileset id="dist.contents" dir="${ts.home}/dist/${pkg.dir}" includes="jaxrs*.war.template"/>
+    <property name="prop.dist.contents" refid="dist.contents"/>
+    <propertyregex property="app.name"
+                   input="${prop.dist.contents}"
+                   regexp="_web.war.template$"
+                   replace=""/>
+  </target>
 
-        <!--
-        Create implementation specfic war files with
-            updated web.xml;
-            servlet class;
-        -->
-        <fileset id="dist.contents" dir="${ts.home}/dist/${pkg.dir}" includes="jaxrs*.war.template"/>
-        <property name="prop.dist.contents" refid="dist.contents"/>
-        <echo>${prop.dist.contents}</echo>
-        <propertyregex property="app.name.1"
-                       input="${prop.dist.contents}"
-                       regexp=" "
-                       replace=""/>
-        <propertyregex property="app.name"
-                       input="${prop.dist.contents}"
-                       regexp="_web.war.template$"
-                       replace=""/>
-        <echo>${app.name}</echo>
+  <target name="updatewar" depends="get.app.name" if="app.name">
+    <!-- Copy web.war.template to web.war.cxf -->
+    <jar destfile="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}" update="true">
+      <zipfileset src="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.template"
+                  excludes="WEB-INF/web.xml"/>
+    </jar>
+    <!-- Copy web.xml to web.war.cxf -->
+    <jar destfile="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}" update="true">
+      <zipfileset dir="${ts.home}/dist/${pkg.dir}"
+                  includes="web.xml.${jaxrs_impl_name}"
+                  fullpath="WEB-INF/web.xml"/>
+    </jar>
+    <copy failonerror="false" verbose="true"
+          file="${dist.dir}/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}"
+          tofile="${dist.dir}/${pkg.dir}/${app.name}_web.war"/>
+  </target>
 
-        <echo message="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}"/>
-        <copy file="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.template"
-              tofile="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}"/>
+  <!-- for 3.0 servlet wars without web.xml -->
+  <target name="copywar" depends="check.web.xml,get.app.name" if="app.name" unless="exist.web.xml">
+    <copy failonerror="false" verbose="true"
+          file="${dist.dir}/${pkg.dir}/${app.name}_web.war.template"
+          tofile="${dist.dir}/${pkg.dir}/${app.name}_web.war"/>
+  </target>
 
-        <jar destfile="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}" update="true">
-            <zipfileset dir="${ts.home}/src/${pkg.dir}"
-                        includes="web.xml.${jaxrs_impl_name}"
-                        fullpath="WEB-INF/web.xml"/>
-        </jar>
-
-        <!--unjar src="${jaxrs_impl_lib}" dest="${ts.home}/tmp">
-            <patternset>
-                <include name="${servlet_adaptor}"/>
-            </patternset>
-        </unjar>
-
-        <jar destfile="${ts.home}/dist/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}" update="true">
-            <zipfileset dir="${ts.home}/tmp/"
-                        includes="${servlet_adaptor}"
-                        prefix="WEB-INF/classes" />
-        </jar-->
-        
-        <copy failonerror="false"
-              file="${dist.dir}/${pkg.dir}/${app.name}_web.war.${jaxrs_impl_name}"
-              tofile="${dist.dir}/${pkg.dir}/${app.name}_web.war" />
-              <echo message="${jaxrs_impl_name}"/>
-          </target>
-
-      </project>
+</project>