You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Weintraub <qa...@gmail.com> on 2008/08/11 20:25:44 UTC

Jar file keeps appearing in classpath

I have a very weird jarfile that actually has an invalid format
(called bad.jar in this example). I have no earthly idea how it is
used, but we have to include it.

I have a directory called "lib" which is referred to in my build.xml
as "${library.dir}". Inside "${library.dir}" are all the files I need
in my classpath and then some. In my build.xml, I have the following
lines:

        <path id="compile.classpath">
            <fileset dir="${library.dir}">
                <exclude name="**/bad.jar"/>
            </fileset>
            <!-- Depends upon RMS and Base -->
            <fileset dir="${dependencies.dir}">
                <include name="**/*.jar"/>
                <include name="**/*.har"/>
            </fileset>
        </path>

        <property name="classpath.property" refid="compile.classpath"/>
        <echo>DEBUG: CLASSPATH = "${classpath.property}"</echo>
        <javac
            srcdir="${javac.src.dir}"
            destdir="${javac.dest.dir}"
            deprecation="${javac.deprecation.flag}"
            debug="${javac.debug.flag}"
            debuglevel="${javac.debug.level}"
            listfiles="${javac.listfiles.flag}"
            failonerror="${javac.failonerror.flag}"
            target="${javac.target}"
            source="${javac.source}">
            <classpath refid="compile.classpath"/>
        </javac>

And, when I execute the build.xml, I get the following:
$ ant
Buildfile: build.xml

compile:
    [echo] DEBUG: CLASSPATH = "blah, blah, blah"
    [javac] Compiling 73 source files to project/target/compile
    [javac] error: error reading project/lib/bad.jar; error in opening zip file
    [javac] 1 error

I can examine the echo statement where I am printing out the
classpath, and bad.jar does not appear in it. Yet, the javac task is
complaining about bad.jar.

Any ideas?

--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org