[ 
https://issues.apache.org/jira/browse/MRESOLVER-363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17726668#comment-17726668
 ] 

Tamas Cservenak commented on MRESOLVER-363:
-------------------------------------------

Again, the problem you are facing is Maven default policy. You can change it 
using your own {{~/.m2/settings.xml}} for start. Second, versions upcoming 
release will contain a change that IN CASE of "display xxx updates" and similar 
goals it overrides the (most probably default) policy to "daily".

Second, in maveniverse, release artifacts are immutable (byte wise, so you once 
download org:lib:1.0, it will NEVER change, nor in your local repo nor 
remotely). Then, release repositories "only go forward", meaning, org:lib:1.0 
once deployed, is there to stay forever, not change, only new versions (but 
then we already talk about "other" artifact, it is not "same" as org:lib:1.0) 
may be deployed tomorrow or after, like org:lib:1.1 or org:lib:2.0 etc. These 
are long time ago established Maven fundamentals.

Second, Maven looks "your" aspect (the POM), not "remote repo" aspect. During a 
build, Maven will not go "hey, look, there is a new version of this and this 
over there!", it instead takes your POM and builds it. And in POM there are no 
uncertainties, you tell exact GAV for plugins, dependencies, etc.  So it is 
you, that are telling maven what artifact to pick up. Maven does not tinker 
about anything. And hence, maven is able to go directly for referenced artifact.

versions plugin is not build plugin, it is a handy "helper" plugin that helps 
you keep your build and dependencies up to date. And it uses aspect of resolver 
that Maven does NOT use. Still, resolver, that is configured by Maven, tries 
it's best to deliver the expected. And due defaults, people used to invoke 
{{mvn -U versions:display...}}. But again, all this is about to change in 
latest versions plugin release (will make {{-U}} not needed).

Local repository is a badly named cache. It is a cache. It holds two kinds of 
things: locally built and installed (to be able to share them "across 
sessions", or in plain words, across invocation between different projects), 
and remotely fetched ones. Local repository does not have "update policy", it 
is remote repository (from which files are downloaded and cached to local 
repository) having that attribute.

The properties file is there as metadata IS updated, when asked for, based on 
update policy.


> Maven metadata is not updated in some cases
> -------------------------------------------
>
>                 Key: MRESOLVER-363
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-363
>             Project: Maven Resolver
>          Issue Type: Bug
>    Affects Versions: 1.9.10
>            Reporter: Tamas Cservenak
>            Assignee: Tamas Cservenak
>            Priority: Major
>
> Seems when update check for metadata happens, and:
>  * maven-metadata XML is present, but
>  * resolver-status.properties is not, OR was created by maven-compat, that 
> uses different key for lastUpdated. Effectively the value of lastUpdated is 
> not present.
> The update check falsely DO NOT check for update, as it will end up with 
> update policy "never" in update policy analyzer.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to