简体   繁体   中英

Equivalent mvn eclipse:clean eclipse:eclipse m2e command

I have a Maven error like the following in Eclipse for a Maven project.:

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

I tried: "Right click" -> "Maven" -> "Update Project...", but it does now solve the problem.

Then I tried: mvn eclipse:clean eclipse:eclipse , which solved the problem. But, then the problem is, that it converts the Eclipse Maven project to an Eclipse project. So I have to manually convert it back to an Eclipse Maven project. I also wonder because Apache Maven Eclipse Plugin is RETIRED .

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. 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. Second the Maven->Update Project should fix any misconfiguration.

I would suggest to call mvn clean install in your console to verify that there are no real dependency problems. Eclipse sometimes does not update its index correctly.

Second if the error still appears try to restart your eclipse. I often saw that eclipse-m2e does cache some stra

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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