Skip to main content

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

Andreas Sewe wrote:

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?

Yes, by default a session is meant to only check once for remote updates of a given artifact.

At least for me the corollary is to always create a
new RepositorySystemSession. This seems kind of wasteful

If creating a new session is a real concern, you can simply nuke the key "updateCheckManager.checks" from the SessionData prior to your requests to re-enable remote update checks. I assume you already found the config property "aether.versionResolver.noCache" to disable the version cache.

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.

I agree some more docs would be nice, but JavaDoc feels inadequate. This thing touches on impl details, some living even outside of Aether's own codebase. So a wiki page looks more appropriate.


Benjamin



Back to the top