user2295633
user2295633

Reputation:

Maven: m2eclipse: Disable Workspace Resolution Causes Artifact Missing

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.

Upvotes: 9

Views: 7374

Answers (4)

cece2048
cece2048

Reputation: 1271

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

Upvotes: 0

Monkey Supersonic
Monkey Supersonic

Reputation: 1254

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.

Upvotes: 0

zlinks
zlinks

Reputation: 1067

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

Upvotes: 0

Saif Asif
Saif Asif

Reputation: 5658

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.

Upvotes: 6

Related Questions