ShrinkWrap Resolver Maven API 2.0.0-cr-1

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

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

public class RejectDependenciesStrategy
extends Object
implements MavenResolutionStrategy

MavenResolutionStrategy implementation where specified MavenDependencys may be selectively rejected

Author:
Karel Piwko, Andrew Lee Rubinger

Constructor Summary
RejectDependenciesStrategy(boolean rejectTransitives, String... coordinates)
          Bans all dependencies specified by coordinates possibly including all transitive dependencies that might be fetched by resolving coordinates.
RejectDependenciesStrategy(String... coordinates)
          Bans all dependencies specified by coordinates including all transitive dependencies that might be fetched by resolving coordinates.
 
Method Summary
 MavenResolutionFilter[] getResolutionFilters()
          Returns a MavenResolutionFilter chain blocking MavenDependencys with coordinates supplied at instance construction
 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

RejectDependenciesStrategy

public RejectDependenciesStrategy(String... coordinates)
                           throws IllegalArgumentException,
                                  CoordinateParseException
Bans all dependencies specified by coordinates including all transitive dependencies that might be fetched by resolving coordinates.

Parameters:
coordinates - Coordinates to be banned
Throws:
IllegalArgumentException - If no coordinates are specified
CoordinateParseException - If coordinates does not follow required format

RejectDependenciesStrategy

public RejectDependenciesStrategy(boolean rejectTransitives,
                                  String... coordinates)
                           throws IllegalArgumentException,
                                  CoordinateParseException
Bans all dependencies specified by coordinates possibly including all transitive dependencies that might be fetched by resolving coordinates.

Parameters:
rejectTransitives - Flag to allow rejecting transitive dependencies of specified coordinates
coordinates - Coordinates to be banned
Throws:
IllegalArgumentException - If no coordinates are specified
CoordinateParseException - If coordinates does not follow required format
Method Detail

getResolutionFilters

public MavenResolutionFilter[] getResolutionFilters()
Returns a MavenResolutionFilter chain blocking MavenDependencys with coordinates supplied at instance construction

Specified by:
getResolutionFilters in interface MavenResolutionStrategy
Returns:
See Also:
org.jboss.shrinkwrap.resolver.api.maven.strategy.MavenResolutionStrategy#getPreResolutionFilters()

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.