Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does M2Eclipse complain about missing artifact when mvn command line doesn't?

I've just set up a brand new installation of Eclipse Helios and have configured M2Eclipse to use an external (v 2.2.1) installation of Maven.

The system compiles fine on the command line, but from within M2Eclipse several of my project modules have an error:

Missing artifact javax.jms:jms:jar:1.1:test

I can get past the error by excluding the jms artifact from the Atomikos dependencies. But my main question is how can the two provide different results!

Even more odd is that I have another installation of Eclipse Helios and everything works fine.

like image 265
HDave Avatar asked Nov 25 '10 04:11

HDave


People also ask

How do I fix missing artifact in Maven?

Try right-clicking on the project and select Maven->Update Project. Disable then re-enable dependency management (right-click Maven->Disable Maven Nature then to again convert the project to a Maven project, Right Click on the project and select Configure ->Convert To Maven Project.

What is missing artifact error in POM XML?

The error in pom. xml “missing artifact maven” occurs when the artifact is missing in local repository and remote repository. In eclipse, missing artifact maven error shows in the programs window. Maven is a software tool for building artifacts.


2 Answers

The dependency resolver in m2eclipse is not using the external Maven installation, it has to use the embedded Maven version. So, I'd recommend to get the latest version of m2eclipse, as well as Maven 3.x version to minimize the difference in dependency resolution.

like image 108
Eugene Kuleshov Avatar answered Sep 22 '22 01:09

Eugene Kuleshov


Additionally, it is possible that you had some alternative repositories defined in your maven 2.2.1 conf/settings.xml file. If you use the embedded maven3 these will be ignored.

You also can specify your maven 2.2.1 installation as the maven installation for m2eclipse.

like image 43
mglauche Avatar answered Sep 18 '22 01:09

mglauche