Class TrustedChecksumsArtifactResolverPostProcessor
java.lang.Object
org.eclipse.aether.internal.impl.resolution.ArtifactResolverPostProcessorSupport
org.eclipse.aether.internal.impl.resolution.TrustedChecksumsArtifactResolverPostProcessor
- All Implemented Interfaces:
ArtifactResolverPostProcessor
@Singleton
@Named("trustedChecksums")
public final class TrustedChecksumsArtifactResolverPostProcessor
extends ArtifactResolverPostProcessorSupport
Artifact resolver processor that verifies the checksums of all resolved artifacts against trusted checksums. Is also
able to "record" (calculate and write them) to trusted checksum sources, that do support this operation.
It uses a list of ChecksumAlgorithmFactory
ies to work with, by default SHA-1.
Configuration keys:
aether.artifactResolver.postProcessor.trustedChecksums.checksumAlgorithms
- Comma separated list ofChecksumAlgorithmFactory
names to use (default "SHA-1").aether.artifactResolver.postProcessor.trustedChecksums.failIfMissing
- To fail if artifact being validated is missing a trusted checksum (defaultfalse
).aether.artifactResolver.postProcessor.trustedChecksums.snapshots
- Should snapshot artifacts be handled (validated or recorded). Snapshots are by "best practice" in-house produced, hence should be trusted (defaultfalse
).aether.artifactResolver.postProcessor.trustedChecksums.record
- If this value set totrue
, this component with not validate but "record" encountered artifact checksums instead (defaultfalse
).
This component uses TrustedChecksumsSource
as source of checksums for validation and also to "record" the
calculated checksums. To have this component usable, there must exist at least one enabled checksum source. In case
of multiple checksum sources enabled, ALL of them are used as source for validation or recording. This
implies that if two enabled checksum sources "disagree" about an artifact checksum, the validation failure is
inevitable.
- Since:
- 1.9.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The checksum algorithms to apply during post-processing as comma separated list.static final String
Is post processor enabled.static final String
Should post processor fail resolution if checksum is missing?static final String
Should post processor go into "record" mode (and collect checksums instead of validate them)?static final String
Should post processor process snapshots as well?static final String
static final String
-
Constructor Summary
ConstructorDescriptionTrustedChecksumsArtifactResolverPostProcessor
(ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector, Map<String, TrustedChecksumsSource> trustedChecksumsSources) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doPostProcess
(RepositorySystemSession session, List<ArtifactResult> artifactResults) protected boolean
isEnabled
(RepositorySystemSession session) Returnstrue
if session configuration marks this instance as enabled.Methods inherited from class org.eclipse.aether.internal.impl.resolution.ArtifactResolverPostProcessorSupport
postProcess
-
Field Details
-
NAME
- See Also:
-
CONFIG_PROP_ENABLED
Is post processor enabled.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()
- Value type:
Boolean
- Default value:
- false
-
CONFIG_PROP_CHECKSUM_ALGORITHMS
The checksum algorithms to apply during post-processing as comma separated list.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()
- Value type:
String
- Default value:
DEFAULT_CHECKSUM_ALGORITHMS
-
DEFAULT_CHECKSUM_ALGORITHMS
- See Also:
-
CONFIG_PROP_FAIL_IF_MISSING
Should post processor fail resolution if checksum is missing?- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()
- Value type:
Boolean
- Default value:
- false
-
CONFIG_PROP_SNAPSHOTS
Should post processor process snapshots as well?- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()
- Value type:
Boolean
- Default value:
- false
-
CONFIG_PROP_RECORD
Should post processor go into "record" mode (and collect checksums instead of validate them)?- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()
- Value type:
Boolean
- Default value:
- false
-
-
Constructor Details
-
TrustedChecksumsArtifactResolverPostProcessor
@Inject public TrustedChecksumsArtifactResolverPostProcessor(ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector, Map<String, TrustedChecksumsSource> trustedChecksumsSources)
-
-
Method Details
-
isEnabled
Description copied from class:ArtifactResolverPostProcessorSupport
Returnstrue
if session configuration marks this instance as enabled.Default value is
false
.- Specified by:
isEnabled
in classArtifactResolverPostProcessorSupport
-
doPostProcess
- Specified by:
doPostProcess
in classArtifactResolverPostProcessorSupport
-