ShrinkWrap Resolver Maven API 2.0.0-alpha-1

org.jboss.shrinkwrap.resolver.api.maven
Interface MavenDependencyResolver

All Superinterfaces:
ConfiguredMavenDependencyResolver, DependencyBuilder<MavenDependencyBuilder>, ResolverEntryPoint<MavenDependencyResolver>

public interface MavenDependencyResolver
extends ResolverEntryPoint<MavenDependencyResolver>, DependencyBuilder<MavenDependencyBuilder>, ConfiguredMavenDependencyResolver

An artifact builder is object which holds and construct dependencies and it is able to resolve them into an array of ShrinkWrap archives. Artifact builder allows chaining of artifacts, that is specifying a new artifact. In this case, currently constructed artifact is stored as a dependency and user is allowed to specify parameters for another artifact.

Author:
Karel Piwko, Andrew Lee Rubinger, Samuel Santos, Jose Rodolfo Freitas

Method Summary
<T extends ConfiguredMavenDependencyResolver>
T
configureFrom(MavenConfigurationType<T> configurationType)
           
 MavenDependencyResolver disableMavenCentral()
          Disables touching of Maven Central repository.
 MavenDependencyResolver goOffline()
          Disables touching remote repositories at all, rely on local repository only
 EffectivePomMavenDependencyResolver loadEffectivePom(String path)
          Constructs an effective POM loading a POM file from a given resource, which can be either a path to file or a class path resource.
 MavenDependencyResolver loadSettings(String userSettings)
          Configures Maven from a settings.xml file
 
Methods inherited from interface org.jboss.shrinkwrap.resolver.api.DependencyBuilder
artifact, artifacts
 

Method Detail

configureFrom

<T extends ConfiguredMavenDependencyResolver> T configureFrom(MavenConfigurationType<T> configurationType)

loadSettings

MavenDependencyResolver loadSettings(String userSettings)
Configures Maven from a settings.xml file

Parameters:
userSettings - A path to a user settings.xml configuration file
Returns:
A dependency builder with a configuration from given file
Throws:
IllegalArgumentException - If userSettings are not supplied

loadEffectivePom

EffectivePomMavenDependencyResolver loadEffectivePom(String path)
                                                     throws ResolutionException
Constructs an effective POM loading a POM file from a given resource, which can be either a path to file or a class path resource. It grabs definitions of dependencies, dependencies in dependencyManagement and repositories. This are cached and can be later used to simplify the way how user specifies dependencies, e.g. allows user to omit versions which are already present in the POM file.

Parameters:
path - A path to the POM file, must not be null or empty
Returns:
A dependency builder with remote repositories set according to the content of POM file.
Throws:
ResolutionException - If an effective POM cannot be resolved

disableMavenCentral

MavenDependencyResolver disableMavenCentral()
Disables touching of Maven Central repository. This repository is enabled by default in Maven

Returns:
Modified MavenDependencyResolver

goOffline

MavenDependencyResolver goOffline()
Disables touching remote repositories at all, rely on local repository only

Returns:
Modified MavenDependencyResolver

ShrinkWrap Resolver Maven API 2.0.0-alpha-1

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