Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aether-users] In-session caches defeating(?) UPDATE_POLICY_ALWAYS

Hi all,

today I had some time to explore Aether (1.13.1) a bit more.
Unfortunately, most of the time I spent on figuring out that, despite
having UPDATE_POLICY_ALWAYS set in my session, Aether won't look for a
newer version of maven-metadata.xml in the remote repo and hence won't
find newer snapshots -- if one, like I foolishly did, uses the same
RepositorySystemSession for a series of requests.

The first resolution request in the session downloads both metadata and
snapshot artifact, but subsequent VersionRequests are answered based on
a per-session cache that claims that the snapshot's timestamp hasn't
changed, despite there being newer metadata available in the remote repo
and a RepositoryPolicy of UPDATE_POLICY_ALWAYS.

Is this intentional? At least for me the corollary is to always create a
new RepositorySystemSession. This seems kind of wasteful, but until I
get a better understanding of what is cached when, it at least keeps me
sane. ;-)

Maybe the JavaDoc of RepositorySystemSession could mention what is
cached in the current session and how it interacts with on-disk caching
of maven-metadata.xml, resolver-status.properties, and friends.

But don't get me wrong; working with Aether is still a lot of fun.

Best wishes,

Andreas
-- 
Codetrails UG (haftungsbeschränkt)
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940


Back to the top