9

I have project A which depends on projects B and C in my Eclipse workspace.

Sometimes I want A to run using the artifacts B and C from the repository rather the versions in the workspace. Therefore, I select A, and then select 'Maven-> Disable Workspace Resolution' so that A would use the versions from the repository.

However, as soon as I take the above action, I get the error messages "Missing artifact B" and "Missing artifact C" in the pom file of project A.

I've tried to clean up the project, I've select 'Maven | Update' with the option 'Force update of jars/releases' checked. Non of these have resolved the problem.

Am I using 'Maven-> Disable Workspace Resolution' incorrectly?


Additional Info: The exact versions of those projects are in repository. In fact, if I close projects B and C in the workspace, project A happily uses repository versions of B and C.

4 Answers4

6

You will need to have the projects B and C installed in your local m2 repository with the exact versions as they are referenced in the pom.xml of project A.

Saif Asif
  • 5,516
  • 3
  • 31
  • 48
  • 1
    I know. The exact versions of those projects are in repository. In fact, if I close projects B and C in the workspace, project A happily uses repository versions of B and C. –  Nov 20 '13 at 17:59
  • In our environment m2eclipse behavior is the same as mentioned by user2295633 – sgalenski Jun 09 '15 at 13:46
0

This seems to be a known issue (if not a bug) after all: troubleshooting-missing-artifact

I have a similar setup (web project A depends on jar project B) so I try to reproduce as it is described in the above link:

projectA and projectB.
Both project use Maven.
projectA should have a dependency on projectB.
Set up an Eclipse workspace with both projects.
Right click on projectA and go to "Maven ==> Disable Workspace Resolution"
Clean / Update / Rebuild projects.
You get a "Missing Artifact" error message.

In my case this is not happening. Only If I then go to my local repository and delete by hand the directory that contains my project and then do a maven update.

I don't know if it is the eclipse version but I am working on: Eclipse Java EE IDE for Web Developers. Kepler Service Release 2 Build id: 20140224-0627

guy mograbi
  • 27,391
  • 16
  • 83
  • 122
zlinks
  • 1,037
  • 2
  • 16
  • 26
0

I don't understand why zlinks cited the directions to reproduce the error, but not the actual solution (that worked for me at least). So ...

On the repository view ( Window ==> View ==> Other ==> Maven Repository ) you should focus on the unsynched repository ( mine was the local repository ) and then right click and choose "reindex"

That did it.

Monkey Supersonic
  • 1,165
  • 1
  • 10
  • 19
0

I had the same issue, solve this by close and open project B and C.

right click project B and C -> 'Close project' -> maven update project A -> open project B and C

cece2048
  • 1,121
  • 2
  • 11
  • 17