2
votes

I have a path that looks like this

<path id="classpath-ant">
        <fileset dir="${lib-ant-dir}">
            <include name="**/*.jar" />
        </fileset>
        <pathelement location="${template-dir}/hibernate" />
        <path refid="test-classpath" />
        <path refid="ivy-ant-classpath" />
    </path>

My test-classpath includes bunch of jars. I want to exclude one jar (hibernate3.5.2.jar) from that path. How can i do this.

I don't want to change the test-classpath and put an exclude there as it is used by other targets. I want to modify classpath-ant such that it does not include one jar from path refid test-classpath

1

1 Answers

0
votes

You could rename your test-classpath to classpath-common and then add the exclude there. Then, you could simply create a new path and include **/hibernate3.5.2.jar as follows:

 <path id="test-classpath">
        <path refid="classpath-common" />
        <fileset dir="${hibernate.dir}">
            <include name="**/hibernate3.5.2.jar" />
        </fileset>
 </path>

 <path id="classpath-ant">
        <fileset dir="${lib-ant-dir}">
            <include name="**/*.jar" />
        </fileset>
        <pathelement location="${template-dir}/hibernate" />
        <path refid="classpath-base" />
        <path refid="ivy-ant-classpath" />
 </path>