ShrinkWrap Resolver Maven API 2.0.0-cr-1

org.jboss.shrinkwrap.resolver.api.maven.strategy
Class AcceptScopesStrategy

java.lang.Object
  extended by org.jboss.shrinkwrap.resolver.api.maven.strategy.AcceptScopesStrategy
All Implemented Interfaces:
MavenResolutionStrategy, ResolutionStrategy<MavenDependency,MavenResolutionFilter,MavenResolutionStrategy>

public final class AcceptScopesStrategy
extends Object
implements MavenResolutionStrategy

MavenResolutionStrategy implementation where only MavenDependencys in acceptable ScopeTypes are accepted. Note, this implementation is not able to properly filter scopes defined in a pom.xml file. See: SHRINKRES-112

Author:
Karel Piwko, Andrew Lee Rubinger

Constructor Summary
AcceptScopesStrategy(ScopeType... scopes)
          Creates a new instance allowing only the specified ScopeTypes to pass through the getResolutionFilters()
 
Method Summary
 MavenResolutionFilter[] getResolutionFilters()
          Returns a MavenResolutionFilter chain allowing only dependencies in the scopes specified during construction of this instance to pass through
 TransitiveExclusionPolicy getTransitiveExclusionPolicy()
          Defines how transitive dependencies are filtered during the resolution request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcceptScopesStrategy

public AcceptScopesStrategy(ScopeType... scopes)
                     throws IllegalArgumentException
Creates a new instance allowing only the specified ScopeTypes to pass through the getResolutionFilters()

Parameters:
scopes - Allowed scopes, required
Throws:
IllegalArgumentException - If no scopes are specified
Method Detail

getResolutionFilters

public MavenResolutionFilter[] getResolutionFilters()
Returns a MavenResolutionFilter chain allowing only dependencies in the scopes specified during construction of this instance to pass through

Specified by:
getResolutionFilters in interface MavenResolutionStrategy
Returns:
See Also:
api.maven.strategy.MavenResolutionStrategy#getResolutionFilter()

getTransitiveExclusionPolicy

public TransitiveExclusionPolicy getTransitiveExclusionPolicy()
Defines how transitive dependencies are filtered during the resolution request. For default Maven-compliant behavior, use the DefaultTransitiveExclusionPolicy.INSTANCE implementation.

Specified by:
getTransitiveExclusionPolicy in interface MavenResolutionStrategy
Returns:
The TransitiveExclusionPolicy, never null
See Also:
MavenResolutionStrategy.getTransitiveExclusionPolicy()

ShrinkWrap Resolver Maven API 2.0.0-cr-1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.