Behavior
When a remote repository transfer yields no checksum data (the artifact is
fetched but neither .sha1 nor .md5 companion exists for the resource),
AbstractChecksumPolicy.onNoMoreChecksums() raises a
ChecksumFailureException unconditionally:
@Override
public void onNoMoreChecksums() throws ChecksumFailureException {
throw new ChecksumFailureException("Checksum validation failed, no checksums available");
}
WarnChecksumPolicy and FailChecksumPolicy inherit this method without
overriding it, so warn raises the same hard exception as fail in this
code path. The current behavior is pinned by
WarnChecksumPolicyTest.testOnNoMoreChecksums, so it is intentional /
documented state — but the consequence for users is that only
<checksumPolicy>ignore</checksumPolicy> effectively lets transfers proceed
when checksum data is absent, regardless of how the policy is named.
Where this matters in practice
The file:// test-fixture pattern hits this every time. Apache plugins have
been working around it by setting <checksumPolicy>ignore</checksumPolicy>
in src/it[/mrm]/settings.xml. Snapshot from
gh api search/code 2026-06-10:
Added during Maven 4 API migration (June 2024)
The five June-2024 commits cluster within 17 days and four of their subject
lines explicitly read "Switch to Maven 4 API". This is the strongest
empirical signal that Maven 4 / Resolver 2.x made the workaround materially
more common.
Long-standing (pre Maven 4) for file:// + mock-repository-manager IT setups
- apache/maven-dependency-plugin (2014) —
1eef3011
- apache/maven-jlink-plugin (2017) —
56c529d6
- apache/maven-site-plugin (2019) —
45afac34
- apache/maven-shade-plugin (2020) —
52c476a9
- apache/maven-scripting-plugin (2021) —
028a9003
- apache/maven-install-plugin (2022) —
ce0666e4
The pattern has been needed for file:// IT fixtures since at least 2014,
which is the same underlying reason — the layout expects checksums, the
file system does not provide them.
The latest example landed today as apache/maven-ear-plugin#505 (Maven 4
rc-5 IT compatibility), bringing the total to 12 plugins shipping the same
line.
Related
Scope of this issue
This is a behavior observation plus cross-plugin evidence. Solution
proposals will be raised separately on dev@maven.apache.org so the
design discussion happens with the right audience and the issue stays
focused on the empirical signal.
Behavior
When a remote repository transfer yields no checksum data (the artifact is
fetched but neither
.sha1nor.md5companion exists for the resource),AbstractChecksumPolicy.onNoMoreChecksums()raises aChecksumFailureExceptionunconditionally:WarnChecksumPolicyandFailChecksumPolicyinherit this method withoutoverriding it, so
warnraises the same hard exception asfailin thiscode path. The current behavior is pinned by
WarnChecksumPolicyTest.testOnNoMoreChecksums, so it is intentional /documented state — but the consequence for users is that only
<checksumPolicy>ignore</checksumPolicy>effectively lets transfers proceedwhen checksum data is absent, regardless of how the policy is named.
Where this matters in practice
The
file://test-fixture pattern hits this every time. Apache plugins havebeen working around it by setting
<checksumPolicy>ignore</checksumPolicy>in
src/it[/mrm]/settings.xml. Snapshot fromgh api search/code2026-06-10:Added during Maven 4 API migration (June 2024)
2da14745([MCLEAN-123] Switch to Maven 4 API and the new api maven-clean-plugin#20)9dc957dc88ce1593a44cc8ab([MPIR-455] - add support for multi-release JARs. maven-project-info-reports-plugin#70)3716fc1a([MRESOURCES-308] Switch to the Maven 4 API maven-resources-plugin#35)The five June-2024 commits cluster within 17 days and four of their subject
lines explicitly read "Switch to Maven 4 API". This is the strongest
empirical signal that Maven 4 / Resolver 2.x made the workaround materially
more common.
Long-standing (pre Maven 4) for
file://+ mock-repository-manager IT setups1eef301156c529d645afac3452c476a9028a9003ce0666e4The pattern has been needed for
file://IT fixtures since at least 2014,which is the same underlying reason — the layout expects checksums, the
file system does not provide them.
The latest example landed today as apache/maven-ear-plugin#505 (Maven 4
rc-5 IT compatibility), bringing the total to 12 plugins shipping the same
line.
Related
layout-omitted remote checksums. The patch addressed
.asc/ GPGsignature handling but did not extend to the "missing on disk despite
layout expecting checksums" case that drives the workaround above.
Scope of this issue
This is a behavior observation plus cross-plugin evidence. Solution
proposals will be raised separately on
dev@maven.apache.orgso thedesign discussion happens with the right audience and the issue stays
focused on the empirical signal.