Ant构建classpath中的jar产生&QUOT

Ant构建classpath中的jar产生&QUOT

本文介绍了在打开zip文件&QUOT错误,Ant构建classpath中的jar产生"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立在Eclipse与第三方罐一个依赖的项目。我试图生成蚂蚁合适的build文件 - 使用日食内置导出 - > Ant构建功能为出发块

I have a project built in eclipse with a dependencies on 3rd party jars. I'm trying to generate a suitable build file for ant - using eclipses built-in export->ant buildfile feature as a starting block.

当我运行的构建目标,我得到了以下错误:

When I run the build target I get the following error:

[javac] error: error reading /base/repo/FabTrace/lib/apache/geronimo/specs/geronimo-j2ee-management_1.0_spec/1.0/geronimo-j2ee-management_1.0_spec-1.0.jar; error in opening zip file

和整个构建文件(日食自动生成)如下:
(注:上面总是错误引用在classpath中列出的第一个罐子)

And the whole build file (auto-generated by eclipse) looks like this:(NB: the error above always references the first jar listed in the classpath)

<project basedir="." default="build" name="FabTrace">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="/opt/apps/eclipse"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.5"/>
    <property name="source" value="1.5"/>
    <path id="JUnit 4.libraryclasspath">
        <pathelement location="${ECLIPSE_HOME}/plugins/org.junit4_4.5.0.v20090824/junit.jar"/>
        <pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar"/>
    </path>
    <path id="FabTrace.classpath">
        <pathelement location="bin"/>
        <pathelement location="lib/apache/geronimo/specs/geronimo-j2ee-management_1.0_spec/1.0/geronimo-j2ee-management_1.0_spec-1.0.jar"/>
        <pathelement location="lib/apache/geronimo/specs/geronimo-jms_1.1_spec/1.0/geronimo-jms_1.1_spec-1.0.jar"/>
        <pathelement location="lib/commons-collections/commons-collections/3.2/commons-collections-3.2.jar"/>
        <pathelement location="lib/commons-io/commons-io/1.4/commons-io-1.4.jar"/>
        <pathelement location="lib/commons-lang/commons-lang/2.1/commons-lang-2.1.jar"/>
        <pathelement location="lib/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
        <pathelement location="lib/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar"/>
        <pathelement location="lib/javax/activation/activation/1.1/activation-1.1.jar"/>
        <pathelement location="lib/javax/jms/jms/1.1/jms-1.1.jar"/>
        <pathelement location="lib/javax/mail/mail/1.4/mail-1.4.jar"/>
        <pathelement location="lib/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar"/>
        <pathelement location="lib/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar"/>
        <pathelement location="lib/junit/junit/4.4/junit-4.4.jar"/>
        <pathelement location="lib/log4j/log4j/1.2.15/log4j-1.2.15.jar"/>
        <pathelement location="lib/apache/camel/camel-jms-2.0-M1.jar"/>
        <pathelement location="lib/spring/spring-2.5.6.jar"/>
        <pathelement location="lib/apache/camel/camel-bundle-2.0-M1.jar"/>
        <pathelement location="lib/backport-util-concurrent/backport-util-concurrent-3.1.jar"/>
        <pathelement location="lib/commons-pool/commons-pool-1.4.jar"/>
        <pathelement location="lib/apache/camel/camel-activemq-1.1.0.jar"/>
        <pathelement location="lib/apache/activemq/activemq-camel-5.2.0.jar"/>
        <pathelement location="lib/jencks/jencks-2.2-all.jar"/>
        <pathelement location="lib/jencks/jencks-amqpool-2.2.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/activemq-all-5.3.1.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/optional/xbean-spring-3.6.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/activemq-core-5.3.1.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/camel-jetty-2.2.0.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/web/jetty-6.1.9.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/web/jetty-util-6.1.9.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/web/jetty-xbean-6.1.9.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/optional/activemq-optional-5.3.1.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/web/geronimo-servlet_2.5_spec-1.2.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/optional/spring-beans-2.5.6.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/optional/spring-context-2.5.6.jar"/>
        <pathelement location="lib/activemq/apache-activemq-5.3.1/lib/optional/spring-core-2.5.6.jar"/>
        <path refid="JUnit 4.libraryclasspath"/>
    </path>
    <target name="init">
        <mkdir dir="bin"/>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="src/main/java">
                <exclude name="**/*.launch"/>
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="src/test/java">
                <exclude name="**/*.launch"/>
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="config">
                <exclude name="**/*.launch"/>
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>
    <target name="clean">
        <delete dir="bin"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
            <src path="src/main/java"/>
            <classpath refid="FabTrace.classpath"/>
        </javac>
        <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
            <src path="src/test/java"/>
            <classpath refid="FabTrace.classpath"/>
        </javac>
        <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
            <src path="config"/>
            <classpath refid="FabTrace.classpath"/>
        </javac>
    </target>

</project>

(我知道有一个在这里蚀具体的东西,但我得到或没有它的结果相同。)

(I know there's eclipse specific stuff in here. But I get the same results with or without it.)

我做你们的老谷歌搜索和拖网周围没有成功。

I've done ye old google search and trawled around without success.

我可以确认所有的罐子做的确实存在。我也从命令行和sudo的尝试 - 再次,相同的结果。

I can confirm that all the jars do really exist. I've also tried from the commandline and as sudo - again, same results.

任何帮助将大大AP preciated。

Any help would be greatly appreciated.

干杯

推荐答案

根据马丁·克莱顿的建议,我的previous注释复制下面的答案。

As per Martin Clayton's suggestions, my previous comment is copied below as an answer.

的叹息。我已经想通了,因为我已经删除了原先导致这一问题的第一罐(我不相信,即使我真的需要它们了),问题只是移动到下一个罐子...好了,这让我怀疑系统性故障。原来我没有在事实上已经在classpath中aload垃圾罐子。想必搞砸了在某些时候下载或什么的。反正现在所有固定。干杯

"Sigh. I'd figured that because I'd removed the first jars that originally caused this problem (I wasn't even convinced I really needed them any more) and the problem just moved to the next jar... well, that made me suspicious of a systemic fault. Turns out I did in fact have aload of garbage jars on the classpath. Must have screwed up a download or something at some point. Anyway, all fixed now. Cheers"

这篇关于在打开zip文件&QUOT错误,Ant构建classpath中的jar产生&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 02:38