nodje
nodje

Reputation: 299

Maven3 unable to get latest artifact SNAPSHOT version from remote repo

I've been facing this error fro quite a while now. Without being able to trace it back in time precisely, I feel it dates back from the switch to maven3.

Here's what happens:

it doesn't work, I may get compilation error that shows the artifact-SNAPSHOT isn't the lastest one.

I have to either delete the local repo version of artifact-SNAPSHOT or get the lastest source and do a local 'mvn install' of artifact-SNAPSHOT.

Anyone facing the problem? Is it a known bug? If not, what could I check to understand exactly what happens?

cheers

Upvotes: 3

Views: 802

Answers (2)

carlspring
carlspring

Reputation: 32597

This is a bug. Here is a link.

If you have worked on module-A (1.2.3-SNAPSHOT) for a while and you've run:

mvn clean install

This causes your local repository's metadata to 'lock' the artifact, meaning that it won't get updated anymore, as it thinks you're still working on it. So, if, let's say, in a couple of days you start working on module-B which depends on module-A:1.2.3-SNAPSHOT and there is a newer version installed in the remote repository, that version will completely be ignored. Thus, you'll have to remove the local directory that contains this dependency first and then do:

mvn clean install

all over again. Passing the -U doesn't help at all (which would actually be the natural thing to do).

Upvotes: 2

Ralph
Ralph

Reputation: 120771

Is it this bug: http://jira.codehaus.org/browse/MNG-4987 ? -> use maven 3.0.3

Upvotes: 1

Related Questions