开发者

Maven3 unable to get latest artifact SNAPSHOT version from remote repo

开发者 https://www.devze.com 2023-03-19 02:36 出处:网络
I\'ve been facing this error fro quite a while now. Without being able to trace it back in time pr开发者_如何学运维ecisely, I feel it dates back from the switch to maven3.

I've been facing this error fro quite a while now. Without being able to trace it back in time pr开发者_如何学运维ecisely, I feel it dates back from the switch to maven3.

Here's what happens:

  • I deploy artifact-SNAPSHOT from a server to an Artifactory instance
  • I force snapshot update on my local project that depends on artifact-SNAPSHOT

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


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).


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号