查找失踪的Maven文物 [英] Finding missing Maven artifacts

查看:239
本文介绍了查找失踪的Maven文物的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很熟悉Maven,而且还在追加依赖关系。我正在尝试将现有的项目转换为Maven,并且在添加了引用库中所有jar的依赖项后,收到有关缺失工件的错误消息:

 缺少的工件stax:stax:jar:1.0 
缺少的工件三叶草:clover:jar:1.3-rc4
缺少的工件log4j:log4j:bundle:1.2.16
缺少的工件stax:stax-ri:jar:1.0

从阅读这篇文章: a href =http://stackoverflow.com/questions/5390732/how-to-handle-maven-missing-artifact-errors>如何处理Maven缺少人工错误?,这听起来像我需要手动下载这些jar并将其添加到我的本地maven仓库。我的问题是如何找到这些罐子?我尝试谷歌他们,我可以找到类似名称的罐子,但不完全像这样,所以我不知道他们是否是正确的罐子。



处理此问题的任何提示? log4j jar是我原来项目的引用库中唯一明确列出的jar,所以我猜其他的jar是我需要的,我不知道在哪里找到它们或什么确切的名字应该是。



谢谢!

解决方案

。这个问题的实际原因是,对于这3个缺失的工件中的每一个,由于某种原因,当Maven将它们下载到本地存储库中时,.lastUpdated附加到该jar的末尾。例如,stax-1.0.jar.lastUpdated。这是Maven找不到stax-1.0.jar的原因。



所以,为了解决这个问题,我不得不手动下载stax-1.0.jar,然后将它安装到与混乱的完全相同的地方的本地maven仓库中文件,以便Maven可以找到它。 (例如,使用命令:

  mvn install:install-file -Dfile =< path-to-file> / stax-1.0.jar 
-DgroupId = stax -DartifactId = stax -Dversion = 1.0 -Dpackaging = jar

使用与现有的不正确文件相同的确切的groupId和artifactId对于maven来说是非常重要的。


I'm new to Maven, and struggling with adding dependencies. I'm trying to convert an existing project to Maven, and after adding the dependencies for all the jars in my referenced libraries, I'm receiving an error message about missing artifacts:

Missing artifact stax:stax:jar:1.0    
Missing artifact clover:clover:jar:1.3-rc4
Missing artifact log4j:log4j:bundle:1.2.16
Missing artifact stax:stax-ri:jar:1.0

From reading this post: How to handle Maven missing artifact errors?, it sounds like I need to manually download these jars and add them to my local maven repository. My question is how do I find these jars? I tried googling them, and I can find jars that have similar names, but not exactly like these, so I'm not sure if they're the right jars.

Any tips for dealing with this problem? The log4j jar is the only one explicitly listed in the referenced libraries of my original project, so I'm guessing the other ones are required by other jars that I have, and I don't know where to find them or what their exact names should be.

Thanks!

解决方案

Thanks to everyone for responding. The actual cause of the problem is that for each of those 3 missing artifacts, for some reason, when Maven downloaded them into my local repository, .lastUpdated was appended to the end of the jar. For example, stax-1.0.jar.lastUpdated. This is the reason Maven could not find stax-1.0.jar.

So, to fix this problem, I had to manually download stax-1.0.jar, then install it into the local maven repository in the exact same place as the messed up file, so that Maven could find it. (For example, using the command:

mvn install:install-file -Dfile=<path-to-file>/stax-1.0.jar         
-DgroupId=stax -DartifactId=stax -Dversion=1.0 -Dpackaging=jar

Using the same exact groupId and artifactId as the existing, incorrect file was crucial in order for maven to find it.

这篇关于查找失踪的Maven文物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆