Maven SNAPSHOT issue

Brent Putman putmanb at georgetown.edu
Sat Mar 16 03:21:55 EDT 2013


>From the first thing in the call minutes today:  It sounded like the
issue was that for someone (it seemed to them like) a newer version of a
SNAPSHOT wasn't being fetched from Nexus, and instead an older local one
was being used?

The thing I was thinking about was the <updatePolicy> that can be
applied to a repository definition.  It can appear both in local
settings.xml and the project POM:

http://maven.apache.org/pom.html#Repositories
http://maven.apache.org/settings.html#Repositories

It defaults to 'daily', meaning (as I understand it) it checks the repo
only once a day for updates for a given dependency.  So just speculating
that: if you were inside the current 24 hour window for a given
dependency, it might seem like it is favoring the older local one, but
really it just doesn't think it should look for a newer one yet from the
repo.    I believe I saw somewhere that it uses the metadata from the
local maven-metadata-local.xml for this purpose, they have 'updated' and
'lastUpdated' fields in them.

If so, perhaps the issue is the <updatePolicy> for the snapshot
repository should be set to 'always', or perhaps at least 'interval:X',
with X at some reasonable number of minutes. 

Can anyone reproduce the issue consistently so that this could be tested?

--Brent





More information about the dev mailing list