Package org.eclipse.aether.internal.impl
Class DefaultRemoteRepositoryManager
java.lang.Object
org.eclipse.aether.internal.impl.DefaultRemoteRepositoryManager
- All Implemented Interfaces:
RemoteRepositoryManager
@Singleton
@Named
public class DefaultRemoteRepositoryManager
extends Object
implements RemoteRepositoryManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFlag indicating whether session authentication (i.e.static final StringFlag indicating whether the merge of a repository's release and snapshot policies (used when a single effective policy has to serve both natures, most notably for metadata of nature RELEASE_OR_SNAPSHOT such asmaven-metadata.xmlversion lists) may pick the weaker of the two checksum policies, which was the legacy behavior.static final StringFlag indicating whether a repository declared by a remote artifact descriptor (POM) may weaken the checksum policy of the operator-defined mirror it is merged into.static final booleanstatic final booleanstatic final boolean -
Constructor Summary
ConstructorsConstructorDescriptionDefaultRemoteRepositoryManager(UpdatePolicyAnalyzer updatePolicyAnalyzer, ChecksumPolicyProvider checksumPolicyProvider, RepositoryKeyFunctionFactory repositoryKeyFunctionFactory) -
Method Summary
Modifier and TypeMethodDescriptionaggregateRepositories(RepositorySystemSession session, List<RemoteRepository> dominantRepositories, List<RemoteRepository> recessiveRepositories, boolean recessiveIsRaw) Aggregates repository definitions by merging duplicate repositories and optionally applies mirror, proxy and authentication settings from the supplied session.aggregateRepositories(RepositorySystemSession session, List<RemoteRepository> dominantRepositories, List<RemoteRepository> recessiveRepositories, boolean recessiveIsRaw, boolean recessiveIsFromDescriptor) Aggregates repository definitions by merging duplicate repositories and optionally applies mirror, proxy and authentication settings from the supplied session, additionally distinguishing the provenance of the recessive repository definitions.getPolicy(RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots) Gets the effective repository policy for the specified remote repository by merging the applicable snapshot/release policy of the repository with global settings from the supplied session.
-
Field Details
-
CONFIG_PROP_AUTH_TO_DESCRIPTOR_REPOSITORIES
Flag indicating whether session authentication (i.e. credentials configured insettings.xml) may be applied, matched by plain repository ID, to repositories declared by remote artifact descriptors (POMs) that are merged into the effective repository list during dependency collection. When disabled (the default), session authentication is only applied to such a repository when an operator-defined mirror has been selected for it; if credentials would have matched a descriptor-declared repository, a warning naming the repository ID and URL is logged instead. Repositories supplied by the build itself (e.g. aggregated viaRepositorySystem#newResolutionRepositories) are unaffected and keep receiving matching credentials. Enabling this restores the legacy behavior of applying matching session authentication to descriptor declared repositories regardless of their provenance.- Since:
- 2.0.23
- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Boolean- Default value:
DEFAULT_AUTH_TO_DESCRIPTOR_REPOSITORIES
-
DEFAULT_AUTH_TO_DESCRIPTOR_REPOSITORIES
- See Also:
-
CONFIG_PROP_RAW_CHECKSUM_POLICY_DOWNGRADE
Flag indicating whether a repository declared by a remote artifact descriptor (POM) may weaken the checksum policy of the operator-defined mirror it is merged into. When disabled (the default), the effective checksum policy of a mirror never becomes weaker than what the mirror itself declares for the same nature: a recessive raw repository may still enable a nature or influence update policies, but a weaker checksum policy (e.g.<checksumPolicy>ignore</checksumPolicy>in a transitive POM) is not honored and a warning is logged instead. Enabling this restores the legacy weakest-wins merge, which let any POM in the dependency graph degrade or switch off checksum verification for downloads routed through the mirror.- Since:
- 2.0.23
- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Boolean- Default value:
DEFAULT_RAW_CHECKSUM_POLICY_DOWNGRADE
-
DEFAULT_RAW_CHECKSUM_POLICY_DOWNGRADE
- See Also:
-
CONFIG_PROP_NATURE_MERGE_WEAKEST_CHECKSUM_POLICY
Flag indicating whether the merge of a repository's release and snapshot policies (used when a single effective policy has to serve both natures, most notably for metadata of nature RELEASE_OR_SNAPSHOT such asmaven-metadata.xmlversion lists) may pick the weaker of the two checksum policies, which was the legacy behavior. When disabled (the default), the stronger of the two checksum policies wins, so enabling snapshots with a lenient checksum policy no longer silently downgrades checksum enforcement below what the operator configured for releases (or vice versa). An explicit checksum policy set on the session (e.g. via--strict-checksums) takes precedence over either behavior, as before.- Since:
- 2.0.23
- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Boolean- Default value:
DEFAULT_NATURE_MERGE_WEAKEST_CHECKSUM_POLICY
-
DEFAULT_NATURE_MERGE_WEAKEST_CHECKSUM_POLICY
- See Also:
-
-
Constructor Details
-
DefaultRemoteRepositoryManager
@Inject public DefaultRemoteRepositoryManager(UpdatePolicyAnalyzer updatePolicyAnalyzer, ChecksumPolicyProvider checksumPolicyProvider, RepositoryKeyFunctionFactory repositoryKeyFunctionFactory)
-
-
Method Details
-
aggregateRepositories
public List<RemoteRepository> aggregateRepositories(RepositorySystemSession session, List<RemoteRepository> dominantRepositories, List<RemoteRepository> recessiveRepositories, boolean recessiveIsRaw) Description copied from interface:RemoteRepositoryManagerAggregates repository definitions by merging duplicate repositories and optionally applies mirror, proxy and authentication settings from the supplied session.- Specified by:
aggregateRepositoriesin interfaceRemoteRepositoryManager- Parameters:
session- The repository session during which the repositories will be accessed, must not benull.dominantRepositories- The current list of remote repositories to merge the new definitions into, must not benull.recessiveRepositories- The remote repositories to merge into the existing list, must not benull.recessiveIsRaw-trueif the recessive repository definitions have not yet been subjected to mirror, proxy and authentication settings,falseotherwise.- Returns:
- The aggregated list of remote repositories, never
null. - See Also:
-
aggregateRepositories
public List<RemoteRepository> aggregateRepositories(RepositorySystemSession session, List<RemoteRepository> dominantRepositories, List<RemoteRepository> recessiveRepositories, boolean recessiveIsRaw, boolean recessiveIsFromDescriptor) Description copied from interface:RemoteRepositoryManagerAggregates repository definitions by merging duplicate repositories and optionally applies mirror, proxy and authentication settings from the supplied session, additionally distinguishing the provenance of the recessive repository definitions. Repository definitions that originate from a remote artifact descriptor (i.e. a POM downloaded during dependency collection) are remotely supplied input: implementations may withhold session authentication from them unless an operator-defined mirror has been selected for them, so that session authentication is applied only to repositories the operator configured. Repository definitions supplied by the build itself (e.g. viaRepositorySystem#newResolutionRepositories) must keep receiving mirror, proxy and authentication settings as documented forRemoteRepositoryManager.aggregateRepositories(RepositorySystemSession, List, List, boolean).The default implementation ignores the provenance hint and delegates to
RemoteRepositoryManager.aggregateRepositories(RepositorySystemSession, List, List, boolean).- Specified by:
aggregateRepositoriesin interfaceRemoteRepositoryManager- Parameters:
session- The repository session during which the repositories will be accessed, must not benull.dominantRepositories- The current list of remote repositories to merge the new definitions into, must not benull.recessiveRepositories- The remote repositories to merge into the existing list, must not benull.recessiveIsRaw-trueif the recessive repository definitions have not yet been subjected to mirror, proxy and authentication settings,falseotherwise.recessiveIsFromDescriptor-trueif the recessive repository definitions were declared by a remote artifact descriptor (POM) rather than by the build itself,falseotherwise.- Returns:
- The aggregated list of remote repositories, never
null. - See Also:
-
getPolicy
public RepositoryPolicy getPolicy(RepositorySystemSession session, RemoteRepository repository, boolean releases, boolean snapshots) Description copied from interface:RemoteRepositoryManagerGets the effective repository policy for the specified remote repository by merging the applicable snapshot/release policy of the repository with global settings from the supplied session.- Specified by:
getPolicyin interfaceRemoteRepositoryManager- Parameters:
session- The repository session during which the repository will be accessed, must not benull.repository- The remote repository to determine the effective policy for, must not benull.releases-trueif the policy for release artifacts needs to be considered,falseif not.snapshots-trueif the policy for snapshot artifacts needs to be considered,falseif not.- Returns:
- The effective repository policy, never
null. - See Also:
-