Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-7802][MNG-7803] Fix behaviour of the maven update policy (draft) #1144

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Jun 2, 2023

JIRA issue: MNG-7802

After several iterations, this PR simply provides a custom UpdateCheckManager which can implement the desired policy : artifacts are considered immutable once downloaded from a repository. The updatePolicy defined in repositories affect the metadata retrieval only, i.e. checks for LATEST, SNAPSHOT, and more generally all version resolution requests.

This PR also fix the CLI options as part of MNG-7803:

  • deprecate -nsu, --no-snapshot-updates and --update-snapshots option
  • add -U-/--update-always, -un/--update-never, -ud/--update-daily, -up/--update-policy` CLI options

@gnodet gnodet marked this pull request as draft June 2, 2023 15:55
@gnodet gnodet force-pushed the MNG-7802-fix-update-policy branch from 97f9e60 to d0189a3 Compare June 2, 2023 16:24
@michael-o michael-o self-requested a review June 2, 2023 16:40
@cstamas
Copy link
Member

cstamas commented Jun 2, 2023

Looks good, but: not good, added comment on MNG-7802 intead.

But

  • the CLI -U help text should be aligned with reality (is not "snapshot update" but "all update., Change the help text accordingly)
  • as IT failures show, IF -U present, do what happened before (stick ALWAYS to session), if not present, do partially what in this PR

Reasoning: This PR makes -U not override anymore the "remembered to fail" of resolver in local repo, as shown in ITs.

"Remembered to fail" when resolver emits Could not resolve dependencies for project org.apache.maven.its.mng4343:test:jar:0.1: The following artifacts could not be resolved: org.apache.maven.its.mng4343:dep:jar:0.1 (absent): org.apache.maven.its.mng4343:dep:jar:0.1 was not found in http://localhost:49378/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of maven-core-it has elapsed or updates are forced

@gnodet gnodet marked this pull request as ready for review June 6, 2023 08:46
@gnodet gnodet force-pushed the MNG-7802-fix-update-policy branch 2 times, most recently from 551e03f to aae2a17 Compare June 6, 2023 09:41
@gnodet gnodet changed the title [MNG-7802] Fix behaviour of the maven update policy [MNG-7802][MNG-7803] Fix behaviour of the maven update policy Jun 6, 2023
@gnodet gnodet force-pushed the MNG-7802-fix-update-policy branch 2 times, most recently from 7c90865 to efbf354 Compare June 6, 2023 22:54
@michael-o michael-o removed their request for review June 8, 2023 08:25
@gnodet gnodet requested a review from cstamas June 12, 2023 08:13
@gnodet gnodet force-pushed the MNG-7802-fix-update-policy branch from efbf354 to f49ed2a Compare June 12, 2023 08:38
@gnodet gnodet marked this pull request as draft June 12, 2023 12:02
@gnodet
Copy link
Contributor Author

gnodet commented Jun 12, 2023

Will update the PR when apache/maven-resolver#297 is released.

@gnodet gnodet added this to the 4.0.0-alpha-6 milestone Jun 12, 2023
@gnodet gnodet changed the title [MNG-7802][MNG-7803] Fix behaviour of the maven update policy [MNG-7802][MNG-7803] Fix behaviour of the maven update policy (draft) Jun 12, 2023
@gnodet gnodet modified the milestones: 4.0.0-alpha-6, 4.0.0-alpha-7 Jun 13, 2023
@cstamas
Copy link
Member

cstamas commented Aug 3, 2023

To be done in resolver 2.0.0, please once out upgrade to this instead https://issues.apache.org/jira/browse/MRESOLVER-377

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants