Class ScopeArtifactFilter
- java.lang.Object
-
- org.apache.maven.shared.artifact.filter.ScopeArtifactFilter
-
- All Implemented Interfaces:
org.apache.maven.artifact.resolver.filter.ArtifactFilter,StatisticsReportingArtifactFilter
public class ScopeArtifactFilter extends java.lang.Object implements org.apache.maven.artifact.resolver.filter.ArtifactFilter, StatisticsReportingArtifactFilter
NOTE: None of the fine-grained scopes imply other scopes when enabled; when fine-grained scope control is used, each scope must be enabled separately, UNLESS the corresponding XXXWithImplications() method is used to enable that scope.ArtifactFilterimplementation that selects artifacts based on their scopes.
-
-
Field Summary
Fields Modifier and Type Field Description private booleancompileScopeHitprivate java.util.List<java.lang.String>filteredArtifactIdsprivate booleanincludeCompileScopeprivate booleanincludeNullScopeprivate booleanincludeProvidedScopeprivate booleanincludeRuntimeScopeprivate booleanincludeSystemScopeprivate booleanincludeTestScopeprivate booleannullScopeHitprivate booleanprovidedScopeHitprivate booleanruntimeScopeHitprivate booleansystemScopeHitprivate booleantestScopeHit
-
Constructor Summary
Constructors Constructor Description ScopeArtifactFilter()Constructor that is meant to be used with fine-grained manipulation to enable/disable specific scopes using the associated mutator methods.ScopeArtifactFilter(java.lang.String scope)Constructor that uses the implied nature of Maven scopes to determine which artifacts to include.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasMissedCriteria()booleaninclude(org.apache.maven.artifact.Artifact artifact)booleanisIncludeCompileScope()booleanisIncludeProvidedScope()booleanisIncludeRuntimeScope()booleanisIncludeSystemScope()booleanisIncludeTestScope()voidreportFilteredArtifacts(org.codehaus.plexus.logging.Logger logger)voidreportMissedCriteria(org.codehaus.plexus.logging.Logger logger)ScopeArtifactFilterreset()Reset hit counts and tracking of filtered artifacts, BUT NOT ENABLED SCOPES.ScopeArtifactFiltersetIncludeCompileScope(boolean pIncludeCompileScope)ScopeArtifactFiltersetIncludeCompileScopeWithImplications(boolean enabled)Manages the following scopes: system provided compileScopeArtifactFiltersetIncludeNullScope(boolean enable)Determine whether artifacts that have a null scope are included or excluded.ScopeArtifactFiltersetIncludeProvidedScope(boolean pIncludeProvidedScope)ScopeArtifactFiltersetIncludeRuntimeScope(boolean pIncludeRuntimeScope)ScopeArtifactFiltersetIncludeRuntimeScopeWithImplications(boolean enabled)Manages the following scopes: compile runtimeScopeArtifactFiltersetIncludeSystemScope(boolean pIncludeSystemScope)ScopeArtifactFiltersetIncludeTestScope(boolean pIncludeTestScope)ScopeArtifactFiltersetIncludeTestScopeWithImplications(boolean enabled)Manages the following scopes: system provided compile runtime testjava.lang.StringtoString()
-
-
-
Field Detail
-
includeCompileScope
private boolean includeCompileScope
-
includeRuntimeScope
private boolean includeRuntimeScope
-
includeTestScope
private boolean includeTestScope
-
includeProvidedScope
private boolean includeProvidedScope
-
includeSystemScope
private boolean includeSystemScope
-
includeNullScope
private boolean includeNullScope
-
nullScopeHit
private boolean nullScopeHit
-
compileScopeHit
private boolean compileScopeHit
-
runtimeScopeHit
private boolean runtimeScopeHit
-
testScopeHit
private boolean testScopeHit
-
providedScopeHit
private boolean providedScopeHit
-
systemScopeHit
private boolean systemScopeHit
-
filteredArtifactIds
private final java.util.List<java.lang.String> filteredArtifactIds
-
-
Constructor Detail
-
ScopeArtifactFilter
public ScopeArtifactFilter()
Constructor that is meant to be used with fine-grained manipulation to enable/disable specific scopes using the associated mutator methods.
-
ScopeArtifactFilter
public ScopeArtifactFilter(java.lang.String scope)
Constructor that uses the implied nature of Maven scopes to determine which artifacts to include. For instance, 'test' scope implies compile, provided, and runtime, while 'runtime' scope implies only compile.- Parameters:
scope- the scope
-
-
Method Detail
-
include
public boolean include(org.apache.maven.artifact.Artifact artifact)
- Specified by:
includein interfaceorg.apache.maven.artifact.resolver.filter.ArtifactFilter
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- Information converted to a string.
-
reportFilteredArtifacts
public void reportFilteredArtifacts(org.codehaus.plexus.logging.Logger logger)
- Specified by:
reportFilteredArtifactsin interfaceStatisticsReportingArtifactFilter- Parameters:
logger- the logger
-
reportMissedCriteria
public void reportMissedCriteria(org.codehaus.plexus.logging.Logger logger)
- Specified by:
reportMissedCriteriain interfaceStatisticsReportingArtifactFilter- Parameters:
logger- the logger
-
hasMissedCriteria
public boolean hasMissedCriteria()
- Specified by:
hasMissedCriteriain interfaceStatisticsReportingArtifactFilter- Returns:
trueif missed criteria;falseotherwise.
-
isIncludeCompileScope
public boolean isIncludeCompileScope()
- Returns:
includeCompileScope
-
setIncludeCompileScope
public ScopeArtifactFilter setIncludeCompileScope(boolean pIncludeCompileScope)
- Parameters:
pIncludeCompileScope- true/false.- Returns:
ScopeArtifactFilter
-
isIncludeRuntimeScope
public boolean isIncludeRuntimeScope()
- Returns:
includeRuntimeScope
-
setIncludeRuntimeScope
public ScopeArtifactFilter setIncludeRuntimeScope(boolean pIncludeRuntimeScope)
- Parameters:
pIncludeRuntimeScope- true/false- Returns:
ScopeArtifactFilter
-
isIncludeTestScope
public boolean isIncludeTestScope()
- Returns:
includeTestScope
-
setIncludeTestScope
public ScopeArtifactFilter setIncludeTestScope(boolean pIncludeTestScope)
- Parameters:
pIncludeTestScope-includeTestScope- Returns:
ScopeArtifactFilter
-
isIncludeProvidedScope
public boolean isIncludeProvidedScope()
- Returns:
includeProvidedScope
-
setIncludeProvidedScope
public ScopeArtifactFilter setIncludeProvidedScope(boolean pIncludeProvidedScope)
- Parameters:
pIncludeProvidedScope- yes/no.- Returns:
ScopeArtifactFilter()
-
isIncludeSystemScope
public boolean isIncludeSystemScope()
- Returns:
includeSystemScope
-
setIncludeSystemScope
public ScopeArtifactFilter setIncludeSystemScope(boolean pIncludeSystemScope)
-
setIncludeCompileScopeWithImplications
public ScopeArtifactFilter setIncludeCompileScopeWithImplications(boolean enabled)
Manages the following scopes:- system
- provided
- compile
- Parameters:
enabled- whether specified scopes should be included- Returns:
- this instance
-
setIncludeRuntimeScopeWithImplications
public ScopeArtifactFilter setIncludeRuntimeScopeWithImplications(boolean enabled)
Manages the following scopes:- compile
- runtime
- Parameters:
enabled- whether specified scopes should be included- Returns:
- this instance
-
setIncludeTestScopeWithImplications
public ScopeArtifactFilter setIncludeTestScopeWithImplications(boolean enabled)
Manages the following scopes:- system
- provided
- compile
- runtime
- test
- Parameters:
enabled- whether specified scopes should be included- Returns:
- this instance
-
setIncludeNullScope
public ScopeArtifactFilter setIncludeNullScope(boolean enable)
Determine whether artifacts that have a null scope are included or excluded.- Parameters:
enable- whether null-scope should be included- Returns:
- this instance
-
reset
public ScopeArtifactFilter reset()
Reset hit counts and tracking of filtered artifacts, BUT NOT ENABLED SCOPES.- Returns:
- this instance
-
-