Solved

how to exclude specfic jars with ant war task

Posted on 2007-11-19
7
7,799 Views
Last Modified: 2012-05-05
Below is the war Task; i want to exclude classes12.jar,jstl-1.1.0.jar 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.MF" 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/*.jar,/classes/**" />
</war>
0
Comment
Question by:chaitu chaitu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 20313258
The exclude/include need to be inside a <fileset>
0
 
LVL 9

Expert Comment

by:ysnky
ID: 20314796
a sample how to exclude;

<!-- Generate the war file -->
    <target name="war" depends="prepare-war">

        <war warfile="${final.war.name}"
             webxml="${conf.dir}/web.xml"
             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
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 20318260

If i write like this, still these 2 jars existing in WEB-INF/lib directory.



<war destFile="${temp.dir}/${x.war.name}" webxml="../web/WEB-INF/web.xml" manifest="../web/META-INF/MANIFEST.MF" duplicate="preserve">
      <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/*.jar,/classes/**" />
</war>
0
Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 20321808
Try

<webinf dir="../web/WEB-INF" includes="**/*.jar" excludes="**/classes12.jar,**/jstl-1.1.0.jar" />

That should be the only element you need for WEB-INF/lib, so get rid of the others
0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 20326458
i write like this and its working.u wrote in that similiar lines only

<webinf dir="../web/WEB-INF" includes="*.tld,*.xml" >
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20326465
OK that's good
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20326708
:-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question