我使用的是SpringSource Tool Suite 2.3.0。最近我根据 jackrabbit 2.0 依赖项的要求将 commons-compress 依赖项添加到pom.xml。更新maven依赖项控制台显示: “缺少工件org.apache.commons:commons-compress:jar:1.0:compile”
我检查了“问题”视图,它显示以下错误:
容器'Maven Dependencies'引用非现有库'C:\ Documents and Settings \ AElshereay.m2 \ repository \ org \ apache \ commons \ commons-compress \ 1.0 \ commons-compress-1.0.jar'
此外:
cvc-complex-type.2.4.c:匹配的通配符是严格的,但是找不到元素'config:simple'的声明。
我不知道最后的是什么!如果有任何事情要做,不要从maven存储库下载提到的jar,即使它就在那里!
拜托,有人可以帮我解决这个问题吗?
提前谢谢。
答案 0 :(得分:2)
我不是100%肯定最后一条错误消息,但是第一个肯定是相关的:你声明了对POM的依赖关系,所以.classpath
更新为指向你本地存储库但是文件无法在其中找到,Eclipse / STS抱怨这一点。
现在,我试图在POM中声明commons-compress依赖:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.0</version>
</dependency>
而且,虽然我可以看到一些关于校验和验证的抱怨:
1/23/10 5:11:10 AM CET: Downloading central : org/apache/commons/commons-compress/1.0/commons-compress-1.0.pom 1/23/10 5:11:10 AM CET: Downloaded [central] -> http://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.0/commons-compress-1.0.pom 1/23/10 5:11:10 AM CET: [WARN] *** CHECKSUM FAILED - Checksum failed on download: local = '325980a09dbbd0c108ece8e7733b462b00e6f2a8'; remote = 'commons-compress-1.0.pom:' - RETRYING 1/23/10 5:11:10 AM CET: Downloading central : org/apache/commons/commons-compress/1.0/commons-compress-1.0.pom 1/23/10 5:11:10 AM CET: Downloaded [central] -> http://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.0/commons-compress-1.0.pom 1/23/10 5:11:11 AM CET: [WARN] *** CHECKSUM FAILED - Checksum failed on download: local = '325980a09dbbd0c108ece8e7733b462b00e6f2a8'; remote = 'commons-compress-1.0.pom:' - IGNORING 1/23/10 5:11:12 AM CET: Downloading central : org/apache/commons/commons-compress/1.0/commons-compress-1.0.jar 1/23/10 5:11:15 AM CET: Downloaded [central] -> http://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.0/commons-compress-1.0.jar 1/23/10 5:11:16 AM CET: [WARN] *** CHECKSUM FAILED - Checksum failed on download: local = '995ae384a0b1e2c66269e6bc5198db8561fb45a2'; remote = 'commons-compress-1.0.jar:' - RETRYING 1/23/10 5:11:16 AM CET: Downloading central : org/apache/commons/commons-compress/1.0/commons-compress-1.0.jar 1/23/10 5:11:18 AM CET: Downloaded [central] -> http://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.0/commons-compress-1.0.jar 1/23/10 5:11:18 AM CET: [WARN] *** CHECKSUM FAILED - Checksum failed on download: local = '995ae384a0b1e2c66269e6bc5198db8561fb45a2'; remote = 'commons-compress-1.0.jar:' - IGNORING
工件 下载。
因此,请检查您是否未使用checksumPolicy
配置中央存储库
设为fail
。在settings.xml
或m2eclipse使用的全局设置( Windows&gt;首选项&gt; Maven&gt;安装)或项目配置文件中查找类似的内容:
<checksumPolicy>fail</checksumPolicy>
如果你找不到那样的东西,那么解决方法就是手动安装commons-compress。