WarnChecksumPolicy: proceed on no checksums#1922
Conversation
Override AbstractChecksumPolicy.onNoMoreChecksums() in WarnChecksumPolicy to log a warning and return instead of inheriting the unconditional throw. Brings the policy in line with its name: warn on issues but proceed. FailChecksumPolicy unchanged. Refs apacheGH-1920.
|
@ascheman Sorry, was faster 😄 please take a peek at other PR and let's reconcile both PRs, as I perso like better your message! |
Thanks! I intentionally started this as draft as I think there are other opportunities (larger ones, check the mail I just sent to dev Mailinglist). Nevertheless, this could be a good first approximation of a solution which we might merge until something better comes up? |
|
This is still draft, on purpose? |
Yes, did you see my mail on the dev list? I see the two opportunities:
For the sake of simplicity (and speed), I would suggest, to merge it now and think about a more general solution later. Having said that, I will now make it ready and leave it to you to merge now or discuss other solutions first. |
|
I will merge this as "least painful" thing, and later can discuss, want 2.0.19 out ASAP. |
|
@cstamas Please assign appropriate label to PR according to the type of change. |
Draft / one shape for discussion — fixes the minimal manifestation of
#1920 while leaving the larger design question open
for
dev@maven.apache.org.Change
Override
AbstractChecksumPolicy.onNoMoreChecksums()inWarnChecksumPolicyso it logs a warning and returns, instead ofinheriting the unconditional
ChecksumFailureExceptionthrow.FailChecksumPolicyis unchanged: it continues to throw via theinherited base behavior.
WarnChecksumPolicyTest.testOnNoMoreChecksums()updated to assert thenew behavior (no exception).
Scope and framing
This is the smallest possible patch that addresses #1920's reported
behavior. It does not touch:
<checksumPolicy>file://vs HTTP transport semanticsBetter checksum control #1782 / Better checksum control #1784 / Checksums: lack of information #1917
Other shapes (transport-aware default in
DefaultChecksumPolicyProvider,new opt-in property like
aether.checksums.noChecksumsOutcomeanalogousto RRF's
noInputOutcome, Maven 4 compatibility-mode flag) arediscussed separately on
dev@maven.apache.org. Marking as draft sothe maintainer can decide whether this minimal shape is the right one,
or whether a broader change is preferred.
Verification
WarnChecksumPolicyTest.testOnNoMoreChecksums()passes locally(JDK 21, Maven 3.9.16,
2.0.19-SNAPSHOT).maven-resolver-impltest suite passes locally.cc @cstamas