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

Tamas Cservenak edited comment on MNG-7802 at 6/3/23 10:28 AM:
---------------------------------------------------------------

Part of the fix may be this (resolver) change: 
[https://github.com/apache/maven-resolver/pull/297]

For this to be complete, things needed:
 * Maven3.x in session factory always sets 
{{aether.updateCheckManager.updatePolicyScope=all}} to make Resolver work in 
"old" way, so this change would not alter Maven3 behaviour (we may or may not 
allow users to toy with this, so set only if not set by user, but IMHO safest 
is to just force "all" as for solution to be complete, Maven3 lacks other 
things, see Maven4)
 * Maven4.x does NOT set (so obey resolver default "metadata" OR user set 
configuration), BUT it should implement following changes as well: make default 
values (when not given) "daily" policy, also make sure that "built in" central 
repo also have "daily" policy. This way, Maven4 would effectively solve the 
problem and no "hacks" become needed scattered in various mojos doing version 
resolution.


was (Author: cstamas):
Part of the fix may be this (resolver) change: 
[https://github.com/apache/maven-resolver/pull/297]

For this to be complete, things needed:
 * Maven3.x in session factory always sets 
{{aether.updateCheckManager.updatePolicyScope=all}} to make Resolver work in 
"old" way, so this change would not alter Maven3 behaviour (we may or may not 
allow users to toy with this, so set only if not set by user, but IMHO safest 
is to just force "all" as for solution to be complete, Maven3 lacks other 
things, see Maven4)
 * Maven4.x does NOT set (so obey resolver default OR user set configuration), 
BUT it should implement following changes as well: make default values (when 
not given) "daily" policy, also make sure that "built in" central repo also 
have "daily" policy. This way, Maven4 would effectively solve the problem and 
no "hacks" become needed scattered in various mojos doing version resolution.

> Fix behaviour of the maven update policy
> ----------------------------------------
>
>                 Key: MNG-7802
>                 URL: https://issues.apache.org/jira/browse/MNG-7802
>             Project: Maven
>          Issue Type: Bug
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>            Priority: Major
>
> The update policy can be specified using the {{-U}} (force update) or 
> {{-nsu}} (no update) options, but those options change the whole repository 
> session policy and override any settings on the repositories.
> This means that if {{-U}} is set, the resolver will attempt to check already 
> downloaded artifacts.  This is wrong and the behaviour has been inherited 
> from maven 2.x.
> What we really wants (and what's implied by the name of the options and docs) 
> is to check for new artifacts / updates, so this mainly affect _version 
> resolution_ and not {_}artifact resolution{_}.



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

Reply via email to