简体   繁体   English

等效的mvn eclipse:clean eclipse:eclipse m2e命令

[英]Equivalent mvn eclipse:clean eclipse:eclipse m2e command

I have a Maven error like the following in Eclipse for a Maven project.: 对于Maven项目,我在Eclipse中遇到类似以下的Maven错误:

Project 'project1' is missing required library: '.../.m2/repository/.../project2/0.37.0-SNAPSHOT/project2-0.37.0-SNAPSHOT.jar'  
The project cannot be built until build path errors are resolved

The error is wrong, because in the parent pom.xml version 0.38.0-SNAPSHOT is defined, which also lies in the .m2 repository as project2-0.38.0-SNAPSHOT.jar 该错误是错误的,因为在父pom.xml中定义了0.38.0-SNAPSHOT版本,该版本也位于.m2存储库中,作为project2-0.38.0-SNAPSHOT.jar

I tried: "Right click" -> "Maven" -> "Update Project...", but it does now solve the problem. 我尝试过:“右键单击”->“ Maven”->“更新项目...”,但现在可以解决问题。

Then I tried: mvn eclipse:clean eclipse:eclipse , which solved the problem. 然后我尝试了: mvn eclipse:clean eclipse:eclipse ,它解决了这个问题。 But, then the problem is, that it converts the Eclipse Maven project to an Eclipse project. 但是,问题在于,它将Eclipse Maven项目转换为Eclipse项目。 So I have to manually convert it back to an Eclipse Maven project. 因此,我必须手动将其转换回Eclipse Maven项目。 I also wonder because Apache Maven Eclipse Plugin is RETIRED . 我还想知道,因为Apache Maven Eclipse插件已停用

Is there another solution to the above Problem? 上述问题还有其他解决方案吗?

Your error messages sais something about 0.37.0-SNAPSHOT but in your text you refere to 0.38.0-SNAPSHOT. 您的错误消息说的是关于0.37.0-SNAPSHOT的信息,但是在文本中您引用的是0.38.0-SNAPSHOT。 Is it a mistake or maybe the version in your dependency is wrong? 是错误的,还是您依赖项中的版本错误?

First your are right not to mix mvn eclipse:eclipse and eclipse-m2e plug-in. 首先,您不混合使用mvn eclipse:eclipse和eclipse-m2e插件是正确的。 Second the Maven->Update Project should fix any misconfiguration. 其次,Maven-> Update Project应该修复所有错误配置。

I would suggest to call mvn clean install in your console to verify that there are no real dependency problems. 我建议您在控制台中调用mvn clean install ,以确认没有真正的依赖问题。 Eclipse sometimes does not update its index correctly. Eclipse有时无法正确更新其索引。

Second if the error still appears try to restart your eclipse. 其次,如果错误仍然出现,请尝试重新启动Eclipse。 I often saw that eclipse-m2e does cache some stra 我经常看到eclipse-m2e确实缓存了一些stra

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

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