简体   繁体   English

在Eclipse中清理Maven后,Maven安装失败

[英]Maven install fails after maven clean in eclipse

I have a maven project in Eclipse and I added some local jar files to the buildpath. 我在Eclipse中有一个maven项目,并向buildpath添加了一些本地jar文件。 If I do not add any dependency to the pom.xml file I am able to execute maven install . 如果不对pom.xml文件添加任何依赖关系,则可以执行maven install Then, if I add those dependencies to the pom the command maven install continues working as well. 然后,如果我将这些依赖项添加到pom则命令maven install继续运行。 Now in this situation if I run maven clean then maven install fails. 现在在这种情况下,如果我运行maven cleanmaven install失败。 Why? 为什么?

I also tried to run Maven -> Update Project but the result is the same. 我也尝试运行Maven > Update Project但是结果是一样的。 What is the problem? 问题是什么?

If you are using non maven dependencies then it will fail to build eg from CLI and in your case in Elipse after cleaning the project as well. 如果您使用的是非Maven依赖项,则在清理项目后,它也将无法从CLI构建,例如在CLI中无法构建。 In order to make it work you have to installl tha JAR you are using as Maven artifact and the ninclude it in POM dependencies like every other library. 为了使其工作,你必须installl塔JAR使用的是作为Maven构件和ninclude它POM依赖像其他库。

Here you have info on how to install 3rd party JARs to local repo 在这里,您可以获得有关如何将第3方JAR安装到本地仓库的信息

https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

我遇到了同样的问题,并通过在pom.xml中手动添加第三方来解决

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

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