@AutoFinal
@CompileStatic
class GrapeChecksumPolicyProvider
extends Object
implements ChecksumPolicyProvider
Supplies the checksum policy Grape uses for remote artifact downloads.
Maven Resolver's stock CHECKSUM_POLICY_FAIL rejects a download both when a
published checksum does not match and when no checksum is published at all. Grape wants
only the first of those: a mismatch means the bytes are not what the repository said they
would be and must never reach the classpath, whereas a repository that simply publishes no
.sha1/.md5 is a common and legitimate situation, particularly for internal
and older repositories.
This provider therefore delegates to the stock org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider for every
policy and wraps only the fail policy, relaxing its
org.eclipse.aether.spi.connector.checksum.ChecksumPolicy#onNoMoreChecksums() response. The result matches the semantics the
Ivy-backed engine has always had, so both Grape engines behave alike.
| Constructor and description |
|---|
GrapeChecksumPolicyProvider(ChecksumPolicyProvider delegate)Wraps the stock checksum policy provider. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
String |
getEffectiveChecksumPolicy(RepositorySystemSession session, String policy1, String policy2)Returns the least strict of the two supplied policies. |
|
ChecksumPolicy |
newChecksumPolicy(RepositorySystemSession session, RemoteRepository repository, TransferResource resource, String policy)Returns the policy for the given resource, relaxing fail to tolerate artifacts
that publish no checksum. |
Wraps the stock checksum policy provider.
delegate - the stock provider whose policies are wrappedReturns the least strict of the two supplied policies.
session - the session during which the request is madepolicy1 - a policy to comparepolicy2 - a policy to compare Returns the policy for the given resource, relaxing fail to tolerate artifacts
that publish no checksum.
session - the session during which the request is maderepository - the repository hosting the resourceresource - the resource the policy will be applied topolicy - the identifier of the policy to applynull if checksums should be ignoredCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.