We are hosting a simple maven repository internally but maven does not seem to pick up new snapshot versions from it. Our local maven repository is configured in settings.xml with:
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
Combine this with something like "mvn -U" and I would expect maven to pick up the latest snapshot version if applicable. As I gather, maven will check the last modified of the metadata.xml and determine from that whether or not the snapshot is updated. However I'm not entirely clear as to which last updated that is. Take for example the following metadata.xml:
<metadata>
<groupId>com.example</groupId>
<artifactId>example-test</artifactId>
<version>1.0-SNAPSHOT</version>
<versioning>
<versions>
<version>1.0-SNAPSHOT</version>
</versions>
<snapshot>
<timestamp>20120427.113221</timestamp>
<buildNumber>1335519141810</buildNumber>
</snapshot>
<lastUpdated>20120427113221</lastUpdated>
</versioning>
Does maven use the lastUpdated tag? The "last-modified" http header? The snapshot.timestamp tag or something else still?
Anyway, the behavior that we are seeing is that it will indeed download the latest metadata.xml but stops there, it does not redownload the snapshot itself.
EDIT: I have noticed that the unique snapshot feature that was optional in maven 2 has become mandatory in maven 3. Is it possible that maven is simply not detecting the updated version? Check out the maven-metadata.xml from the module now:
<metadata modelVersion="1.1.0">
<groupId>com.example</groupId>
<artifactId>example-test</artifactId>
<version>1.0-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20120607.154257</timestamp>
<buildNumber>1339076577</buildNumber>
</snapshot>
<lastUpdated>20120607154257</lastUpdated>
<snapshotVersions>
<snapshotVersion>
<extension>jar</extension>
<value>1.0-20120607.154257-1339076577</value>
<updated>20120607154257</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>
Does maven check the build number? The "updated" tag of the snapshotVersion?