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 Object
implements org.apache.maven.artifact.resolver.filter.ArtifactFilter, StatisticsReportingArtifactFilter
ArtifactFilter
implementation that selects artifacts based on their scopes.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor that is meant to be used with fine-grained manipulation to enable/disable specific scopes using the associated mutator methods.ScopeArtifactFilter
(String scope) Constructor that uses the implied nature of Maven scopes to determine which artifacts to include. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
include
(org.apache.maven.artifact.Artifact artifact) boolean
boolean
boolean
boolean
boolean
void
reportFilteredArtifacts
(org.codehaus.plexus.logging.Logger logger) void
reportMissedCriteria
(org.codehaus.plexus.logging.Logger logger) reset()
Reset hit counts and tracking of filtered artifacts, BUT NOT ENABLED SCOPES.setIncludeCompileScope
(boolean pIncludeCompileScope) setIncludeCompileScopeWithImplications
(boolean enabled) Manages the following scopes: system provided compilesetIncludeNullScope
(boolean enable) Determine whether artifacts that have a null scope are included or excluded.setIncludeProvidedScope
(boolean pIncludeProvidedScope) setIncludeRuntimeScope
(boolean pIncludeRuntimeScope) setIncludeRuntimeScopeWithImplications
(boolean enabled) Manages the following scopes: compile runtimesetIncludeSystemScope
(boolean pIncludeSystemScope) setIncludeTestScope
(boolean pIncludeTestScope) setIncludeTestScopeWithImplications
(boolean enabled) Manages the following scopes: system provided compile runtime testtoString()
-
Constructor Details
-
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
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 Details
-
include
public boolean include(org.apache.maven.artifact.Artifact artifact) - Specified by:
include
in interfaceorg.apache.maven.artifact.resolver.filter.ArtifactFilter
-
toString
-
reportFilteredArtifacts
public void reportFilteredArtifacts(org.codehaus.plexus.logging.Logger logger) - Specified by:
reportFilteredArtifacts
in interfaceStatisticsReportingArtifactFilter
- Parameters:
logger
- The logger.
-
reportMissedCriteria
public void reportMissedCriteria(org.codehaus.plexus.logging.Logger logger) - Specified by:
reportMissedCriteria
in interfaceStatisticsReportingArtifactFilter
- Parameters:
logger
- The logger.
-
hasMissedCriteria
public boolean hasMissedCriteria()- Specified by:
hasMissedCriteria
in interfaceStatisticsReportingArtifactFilter
- Returns:
true
if missed cireteriafalse
otherwise.
-
isIncludeCompileScope
public boolean isIncludeCompileScope()- Returns:
includeCompileScope
-
setIncludeCompileScope
- Parameters:
pIncludeCompileScope
- true/false.- Returns:
ScopeArtifactFilter
-
isIncludeRuntimeScope
public boolean isIncludeRuntimeScope()- Returns:
includeRuntimeScope
-
setIncludeRuntimeScope
- Parameters:
pIncludeRuntimeScope
- true/false- Returns:
ScopeArtifactFilter
-
isIncludeTestScope
public boolean isIncludeTestScope()- Returns:
includeTestScope
-
setIncludeTestScope
- Parameters:
pIncludeTestScope
-includeTestScope
- Returns:
ScopeArtifactFilter
-
isIncludeProvidedScope
public boolean isIncludeProvidedScope()- Returns:
includeProvidedScope
-
setIncludeProvidedScope
- Parameters:
pIncludeProvidedScope
- yes/no.- Returns:
ScopeArtifactFilter()
-
isIncludeSystemScope
public boolean isIncludeSystemScope()- Returns:
includeSystemScope
-
setIncludeSystemScope
-
setIncludeCompileScopeWithImplications
Manages the following scopes:- system
- provided
- compile
- Parameters:
enabled
- whether specified scopes should be included- Returns:
- this instance
-
setIncludeRuntimeScopeWithImplications
Manages the following scopes:- compile
- runtime
- Parameters:
enabled
- whether specified scopes should be included- Returns:
- this instance
-
setIncludeTestScopeWithImplications
Manages the following scopes:- system
- provided
- compile
- runtime
- test
- Parameters:
enabled
- whether specified scopes should be included- Returns:
- this instance
-
setIncludeNullScope
Determine whether artifacts that have a null scope are included or excluded.- Parameters:
enable
- whether null-scope should be included- Returns:
- this instance
-
reset
Reset hit counts and tracking of filtered artifacts, BUT NOT ENABLED SCOPES.- Returns:
- this instance
-