"忽略InnerClasses属性"警告正在杀死Eclipse

Alb*_*iir 13 eclipse apache jar maven

我有几个导入的jar在项目构建时在Eclipse中出现此错误:

[2011-04-08 16:31:48 - MokbeeAndroid] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.sf.antcontrib.logic.ForEach$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
Run Code Online (Sandbox Code Playgroud)

现在,我起初并不在乎,因为没有错误.但我现在已经添加了Apache Sanselan,它有同样的问题.其他Apache jar也可以这样做,而不是每个jar一次,但每个类有一次内部类,这使得每个构建泵出一个可怕的控制台日志.更糟糕的是,每个警告似乎都会降低Eclipse构建过程的速度,最终Eclipse会因内存溢出错误而崩溃.这是我无法构建任何东西的地方,甚至是在我的电脑启动后.

解决方案似乎是重新编译源代码(开源和全部),但是除了Maven之外,没有任何一个可以重新编译,在这样做之后无济于事,我怀疑是首先导致问题.

我并不关心警告的结果,只是Eclipse不会花费所有内存来告诉我它.那么,有没有办法可以解决问题,或者让Eclipse停止放慢速度(可能会跳过那个检查)?

Gar*_*son 8

这给我带来了很多痛苦android-maven-plugin,包括其他库commons-logging.它阻止了我的构建.更糟糕的是,一些图书馆被包含在内,所以简单地使用<exclude>就行不通.通过另一篇文章的一点提示,我确定我可以用这样的东西完全阻止有问题的库:

    <!-- prevent commons-logging from being included by the Google HTTP client 
        dependencies -->
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
        <scope>provided</scope>
    </dependency>
Run Code Online (Sandbox Code Playgroud)


art*_*tol 1

如果您在 Maven 中重新编译库的源代码,您可能需要将 POM 中的 Java 版本更新为 1.6(或您项目中使用的任何 Java 版本)。仅从 Sanselan 来看,我注意到它特别有 1.4 版本。