简体   繁体   English

Maven项目无法读取工件描述符

[英]Maven project failed to read artifact descriptor

I have developed one maven project that uses pom.xml to resolve dependencies,it is build success in my IntelliJIDEA but it's showing build errors in my friend's IntelliJIDEA. 我开发了一个使用pom.xml来解决依赖关系的maven项目,它在我的IntelliJIDEA中成功构建,但是在我朋友的IntelliJIDEA中显示了构建错误。

It says 它说

failed to read artifact descriptor for... 无法读取工件描述符以...

If I copy my local repository to his system and build,it is built success. 如果我将本地存储库复制到他的系统并进行构建,则构建成功。 Please, suggest the possible cause and solutions for this problem. 请提出此问题的可能原因和解决方案。

you are probably referencing libraries that are not public / do only exist on your system. 您可能引用的库不是公共的/仅存在于系统中。

if your project consists of multiple maven artefacts - try mvn install on each of them individually if you are not using a parent/reactor file 如果您的项目包含多个Maven工件-如果您不使用父/反应堆文件,请尝试在每个mvn工件上单独安装mvn

You may need to add a repository URL to your .m2/settings.xml file. 您可能需要将存储库URL添加到.m2 / settings.xml文件中。 If you are able to reach the public repositories from your workplace then you can use one of the big ones out there, just google for them. 如果您能够从工作场所访问公共存储库,则可以使用其中的一个大型存储库,只需使用google即可。 If you can't reach them in your workplace, it may be worthwhile to set up your own mirror with something like Artifactory, then your IT might be willing to allow that one server to have the access needed to mirror the public repositories. 如果您无法在工作场所接触到它们,则可能需要使用Artifactory之类的东西来建立自己的镜像,那么您的IT部门可能愿意允许一台服务器具有镜像公共存储库所需的访问权限。

Update: Since I can't leave comments on other folks questions and answers yet: 更新:由于我还不能对其他人的问题和答案发表评论:

Can you provide the pom.xml contents and tell us which dependency is causing the error? 您能否提供pom.xml内容,并告诉我们导致错误的原因是什么? I can create a test project and add it, and see if it is trying to download other dependencies too, since I have an Artifactory instance that mirrors the public sites. 我可以创建一个测试项目并将其添加,并查看它是否也试图下载其他依赖项,因为我有一个Artifactory实例,该实例可以镜像公共站点。 Then if that is the problem, I can tell you which of those to add to your pom and add with maven install. 然后,如果这是问题,我可以告诉您要添加到pom并通过maven install添加的那些。

Oh, didn't notice that the comments are from '14. 哦,没有注意到这些评论来自'14。 Sheesh, sorry about that. 嘘,对此感到抱歉。 Well, if you are still having any problems feel free to update! 好吧,如果您仍然有任何问题,请随时更新!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM