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

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

We need more discussion here. I fixed locally, and noticed that a UT fails, 
this one:

[https://github.com/apache/maven-resolver/blob/maven-resolver-1.9.10/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManagerTest.java#L427-L434]

My "experiment" PR to address is this:

[https://github.com/apache/maven-resolver/pull/291]

As policy "never" IS in effect. I think Garret does not override it. Effective 
update policies explained here: 
[https://maven.apache.org/ref/3.9.2/maven-settings/settings.html#releases]

So, to me it seems that:
 * reporter case was covered with UT (with exact opposite outcome), am still 
trying to figure out the intent here (why is this expected behavior)
 * otherwise maven behaves "consistently": by default policy "never" is 
applied, so yes, seems Garret is right: in case of downloaded metadata, they 
are NOT updated anymore (!) unless explicitly  asked for with {{-U}}
 * in case of Maven, this seems consistent to me

But, there is a twist: this behavior when combined with versions-maven-plugin, 
may result in undesired result! Today, from experience, almost everyone use 
versions-maven-display-plugin:display-XXX-updates along with {{-U}} switch.

But IMHO, the {{-U}} is like shooting with a cannon on a bird, as it will 
update {_}everything{_}as Maven will set "update" globally here: 
[https://github.com/apache/maven/blob/maven-3.9.2/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java#L168]

This will result in enormous download, basically check ANY file Maven during 
execution "touches", even the versions plugin itself.

So, to me this looks like it is versions-maven-plugin responsibility to set 
this, but in "targeted" way: https://github.com/mojohaus/versions/pull/965

 

 

> 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
>             Fix For: 1.9.11
>
>
> 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