Maven更新项目和依赖项

时间:2013-09-13 12:20:04

标签: java maven

在一个工作到现在的应用程序中,我在Eclipse中运行命令Maven-> Update项目,我开始收到错误。

我尝试通过删除所有本地存储库并再次运行Maven-> Update项目来修复它。但这些是我在Markers视图中仍然看到的错误:

Missing artifact org.slf4j:slf4j-api:jar:1.6.6

Missing artifact org.slf4j:slf4j-api:jar:1.6.6

ArtifactTransferException: Failure to transfer org.slf4j:slf4j-api:jar:1.6.6 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of 

ArtifactTransferException: Failure to transfer org.slf4j:slf4j-api:jar:1.6.6 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of 

Error occured processing XML 'org/springframework/transaction/interceptor/TransactionInterceptor'. See Error Log for more details

代码没有改变,之前工作正常。

如何解决这些错误?

2 个答案:

答案 0 :(得分:0)

我不确定具体提到的罐子。 但是当你构建时,你应该连接到互联网,因为POM中引用的一些外部jar会在构建项目时被下载。 另外请检查提到的jar是否是maven存储库。 jar上面与slf4j有关,所以我认为如果你连接到互联网就会解决它。

答案 1 :(得分:0)

也许SL4J jar已部分下载到您的maven本地存储库中。如果它存在于本地存储库中,请尝试删除它。如果失败,请尝试创建一个名为repository的新目录;我的存储在〜/ .m2(ubuntu)中。出于偏执,我将当前目录重命名为不丢失其中已经存在的罐子。