Class ScopeManagerImpl
- All Implemented Interfaces:
InternalScopeManager, ScopeManager
-
Nested Class Summary
Nested classes/interfaces inherited from interface InternalScopeManager
InternalScopeManager.Mode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDependencyScope(String id, boolean transitive, Collection<BuildScopeQuery> presence) Creates dependency scope instance.createResolutionScope(String id, Set<String> aliases, InternalScopeManager.Mode mode, Collection<BuildScopeQuery> wantedPresence, Collection<DependencyScope> explicitlyIncluded, Collection<DependencyScope> transitivelyExcluded) Creates resolution scope instance with aliases.createSystemDependencyScope(String id, boolean transitive, Collection<BuildScopeQuery> presence, String systemPathProperty) Creates system dependency scope instance.booleangetDependencyFilter(RepositorySystemSession session, ResolutionScope resolutionScope) Resolver scope configuration specific: dependency filter to be used to support this scope (with its dependency and resolution scopes).Returns a specific dependency scope by label.getDependencyScopeMainProjectBuildScope(DependencyScope dependencyScope) Returns theBuildScopethat this scope deem as main.Returns the "universe" (all) of dependency scopes as immutable collection.intgetDependencyScopeWidth(DependencyScope dependencyScope) The "width" of scope: is basically sum of all distinctProjectPathandBuildPaththat are in build scopes the scope is present in.getDependencySelector(RepositorySystemSession session, ResolutionScope resolutionScope) Resolver scope configuration specific: dependency selector to be used to support this scope (with its dependency and resolution scopes).getId()The label.Returns a specific resolution scope by label.Returns the "universe" (all) of resolution scopes as immutable collection.Returns the "system" scope, if exists.inthashCode()postProcess(RepositorySystemSession session, ResolutionScope resolutionScope, CollectResult collectResult) Resolver specific: post-processing to be used to support this scope (with its dependency and resolution scopes).toString()Methods inherited from interface InternalScopeManager
createResolutionScope
-
Constructor Details
-
ScopeManagerImpl
-
-
Method Details
-
getId
Description copied from interface:ScopeManagerThe label.- Specified by:
getIdin interfaceScopeManager- Returns:
- The identifier of this scope manager, never
null.
-
getSystemDependencyScope
Description copied from interface:ScopeManagerReturns the "system" scope, if exists.This is a special scope. In this scope case, Resolver should handle it specially, as it has no POM (so is always a leaf on graph), is not in any repository, but is actually hosted on host OS file system. On resolution resolver merely checks is file present or not.
- Specified by:
getSystemDependencyScopein interfaceScopeManager- Returns:
- The system dependency scope, or an empty optional if this manager has no such scope.
-
getDependencyScope
Description copied from interface:ScopeManagerReturns a specific dependency scope by label.Note: despite returns optional, this method may throw as well, if manager set in "strict" mode.
- Specified by:
getDependencyScopein interfaceScopeManager- Parameters:
id- The label of the dependency scope, must not benull.- Returns:
- The dependency scope with the given label, or an empty optional if no such scope exists.
-
getDependencyScopeUniverse
Description copied from interface:ScopeManagerReturns the "universe" (all) of dependency scopes as immutable collection.- Specified by:
getDependencyScopeUniversein interfaceScopeManager- Returns:
- The immutable collection of all known dependency scopes, never
null.
-
getResolutionScope
Description copied from interface:ScopeManagerReturns a specific resolution scope by label.Note: despite returns optional, this method may throw as well, if manager set in "strict" mode.
- Specified by:
getResolutionScopein interfaceScopeManager- Parameters:
id- The label of the resolution scope, must not benull.- Returns:
- The resolution scope with the given label, or an empty optional if no such scope exists.
-
getResolutionScopeUniverse
Description copied from interface:ScopeManagerReturns the "universe" (all) of resolution scopes as immutable collection.- Specified by:
getResolutionScopeUniversein interfaceScopeManager- Returns:
- The immutable collection of all known resolution scopes, never
null.
-
getDependencyScopeWidth
Description copied from interface:InternalScopeManagerThe "width" of scope: is basically sum of all distinctProjectPathandBuildPaththat are in build scopes the scope is present in. The more of them, the "wider" is the scope. Transitive scopes are weighted more as well.The
ProjectPath.order()makes given path "weigh" more. So a scope being present only in "main" project path is wider than scope being present only in "test" project path.Interpretation: the bigger the returned integer is, the "wider" the scope is. The numbers should not serve any other purposes, merely to sort scope instances by "width" (i.e. from "widest" to "narrowest").
- Specified by:
getDependencyScopeWidthin interfaceInternalScopeManager
-
getDependencyScopeMainProjectBuildScope
public Optional<BuildScope> getDependencyScopeMainProjectBuildScope(DependencyScope dependencyScope) Description copied from interface:InternalScopeManagerReturns theBuildScopethat this scope deem as main.- Specified by:
getDependencyScopeMainProjectBuildScopein interfaceInternalScopeManager
-
getDependencySelector
public DependencySelector getDependencySelector(RepositorySystemSession session, ResolutionScope resolutionScope) Description copied from interface:ScopeManagerResolver scope configuration specific: dependency selector to be used to support this scope (with its dependency and resolution scopes).Important: Resolver 2.x when used with
ScopeManager, the scope semantics is defined by client code. Hence, the scopes cannot be interpreted with fixed logic as it was the case in Maven 3.9 and before, instead theScopeManagerhas to be asked to create selector based on scope configuration.- Specified by:
getDependencySelectorin interfaceScopeManager- Parameters:
session- The repository system session, must not benull.resolutionScope- The resolution scope to create the selector for, must not benull.- Returns:
- The dependency selector supporting the given resolution scope, never
null.
-
getDependencyFilter
public DependencyFilter getDependencyFilter(RepositorySystemSession session, ResolutionScope resolutionScope) Description copied from interface:ScopeManagerResolver scope configuration specific: dependency filter to be used to support this scope (with its dependency and resolution scopes).Important: Resolver 2.x when used with
ScopeManager, the scope semantics is defined by client code. Hence, the scopes cannot be interpreted with fixed logic as it was the case in Maven 3.9 and before, instead theScopeManagerhas to be asked to create filter based on scope configuration.- Specified by:
getDependencyFilterin interfaceScopeManager- Parameters:
session- The repository system session, must not benull.resolutionScope- The resolution scope to create the filter for, must not benull.- Returns:
- The dependency filter supporting the given resolution scope, never
null.
-
postProcess
public CollectResult postProcess(RepositorySystemSession session, ResolutionScope resolutionScope, CollectResult collectResult) Description copied from interface:InternalScopeManagerResolver specific: post-processing to be used to support this scope (with its dependency and resolution scopes).- Specified by:
postProcessin interfaceInternalScopeManager
-
createDependencyScope
public DependencyScope createDependencyScope(String id, boolean transitive, Collection<BuildScopeQuery> presence) Description copied from interface:InternalScopeManagerCreates dependency scope instance.Should be invoked only via
ScopeManagerConfiguration.buildDependencyScopes(InternalScopeManager).- Specified by:
createDependencyScopein interfaceInternalScopeManager
-
createSystemDependencyScope
public SystemDependencyScope createSystemDependencyScope(String id, boolean transitive, Collection<BuildScopeQuery> presence, String systemPathProperty) Description copied from interface:InternalScopeManagerCreates system dependency scope instance. This method may be invoked only once, as there can be only one instance ofSystemDependencyScope!Should be invoked only via
ScopeManagerConfiguration.buildDependencyScopes(InternalScopeManager).- Specified by:
createSystemDependencyScopein interfaceInternalScopeManager
-
createResolutionScope
public ResolutionScope createResolutionScope(String id, Set<String> aliases, InternalScopeManager.Mode mode, Collection<BuildScopeQuery> wantedPresence, Collection<DependencyScope> explicitlyIncluded, Collection<DependencyScope> transitivelyExcluded) Description copied from interface:InternalScopeManagerCreates resolution scope instance with aliases.Should be invoked only via
ScopeManagerConfiguration.buildResolutionScopes(InternalScopeManager).- Specified by:
createResolutionScopein interfaceInternalScopeManager
-
equals
-
hashCode
-
toString
-