chaitu chaitu
asked on
how to exclude specfic jars with ant war task
Below is the war Task; i want to exclude classes12.jar,jstl-1.1.0.j ar in WEB-INF/lib of x.war; but when i open x.war(WEB-INF/lib) still classes12.jar existing.how to exclude classes12.jar in my WEB-INF/lib of x.war.
<war destFile="${temp.dir}/${x. war.name}" webxml="../web/WEB-INF/web .xml" manifest="../web/META-INF/ MANIFEST.M F" duplicate="preserve">
<classes dir="${web.compile.dir}"/>
<fileset dir="../web/" includes="jsp/**"/>
<fileset dir="../web/" includes="*.jsp"/>
<fileset dir="../web/" includes="*.html"/>
<lib dir="../web/WEB-INF/lib">
<exclude name="classes12.jar"/>
<exclude name="jstl-1.1.0.jar"/>
</lib>
<webinf dir="../web/WEB-INF" excludes="web.xml,/lib/*.j ar,/classe s/**" />
</war>
<war destFile="${temp.dir}/${x.
<classes dir="${web.compile.dir}"/>
<fileset dir="../web/" includes="jsp/**"/>
<fileset dir="../web/" includes="*.jsp"/>
<fileset dir="../web/" includes="*.html"/>
<lib dir="../web/WEB-INF/lib">
<exclude name="classes12.jar"/>
<exclude name="jstl-1.1.0.jar"/>
</lib>
<webinf dir="../web/WEB-INF" excludes="web.xml,/lib/*.j
</war>
The exclude/include need to be inside a <fileset>
a sample how to exclude;
<!-- Generate the war file -->
<target name="war" depends="prepare-war">
<war warfile="${final.war.name} "
webxml="${conf.dir}/web.xm l"
manifest="${out.conf.dir}/ manifest">
<classes dir="${out.classes.dir}">
<!-- Do not include test files in the runtime jar -->
<exclude name="**/Test*.*"/>
<exclude name="**/test*.*"/>
<!-- Also exclude the test cactus.properties file -->
<exclude name="cactus.properties"/>
</classes>
<fileset dir="${web.dir}">
<exclude name="test/**"/>
</fileset>
</war>
</target>
for more info;
http://www.ch-open.ch/html/ws/ws01/commons-cactus-23-1.1/doc/ant.html
<!-- Generate the war file -->
<target name="war" depends="prepare-war">
<war warfile="${final.war.name}
webxml="${conf.dir}/web.xm
manifest="${out.conf.dir}/
<classes dir="${out.classes.dir}">
<!-- Do not include test files in the runtime jar -->
<exclude name="**/Test*.*"/>
<exclude name="**/test*.*"/>
<!-- Also exclude the test cactus.properties file -->
<exclude name="cactus.properties"/>
</classes>
<fileset dir="${web.dir}">
<exclude name="test/**"/>
</fileset>
</war>
</target>
for more info;
http://www.ch-open.ch/html/ws/ws01/commons-cactus-23-1.1/doc/ant.html
ASKER
If i write like this, still these 2 jars existing in WEB-INF/lib directory.
<war destFile="${temp.dir}/${x.
<classes dir="${web.compile.dir}"/>
<fileset dir="../web/" includes="jsp/**"/>
<fileset dir="../web/" includes="*.jsp"/>
<fileset dir="../web/" includes="*.html"/>
<fileset dir="../web/WEB-INF/lib">
<exclude name="classes12.jar"/>
<exclude name="jstl-1.1.0.jar"/>
</fileset>
<webinf dir="../web/WEB-INF" excludes="web.xml,/lib/*.j
</war>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i write like this and its working.u wrote in that similiar lines only
<webinf dir="../web/WEB-INF" includes="*.tld,*.xml" >
<webinf dir="../web/WEB-INF" includes="*.tld,*.xml" >
OK that's good
:-)