简体   繁体   中英

Eclipse plugin does not find artifacts in local maven repo

I have a multi module maven project, which builds fine on the command line. When I import the project into eclipse, it complains, that some dependencies cannot be resolved. Most dependencies do get resovled just fine.

I'm getting this error messgae for some dependencies:

Missing artifact com.visual-paradigm.hibernate:orm:jar:20140430 pom.xml /lir    line 2  Maven Dependency Problem

I checked the eclipse maven config and I can see that the dependencies are actually in the local repo.

Any ideas how to get eclipse/maven to resolve this dependencies?

you can try updating settings.xml to be used by plugin.

在此处输入图片说明

Also try updating maven instance eclipse is using.

Edit 1 In eclipse .classpath file see if the entry is present for given jar. I believe there should be entries for other jars as you have mentioned in eclipse. like this

  <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>

Now there can be 2 cases with it

  1. classpath entry is present and somehow jar is not located on specified path.
  2. classpath entry is absent, if not a quick fix would be manually adding it.

After all it turned out, that the missing dependencies were added to the repo using copy paste instead of using install:install-file . Therefore some meta information in the repo was missing.

Deleting them and readding with install:install-file solved the problem.

What's still puzzling is that on the command line maven was happy with this. Even kicking off maven install from eclipse was working fine. It's just the m2eclipse plugin that has a problem with this.

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