|
ShrinkWrap Resolver Aggregator 1.1.0-alpha-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.shrinkwrap.resolver.impl.maven.MavenBuilderImpl
public class MavenBuilderImpl
A default implementation of dependency builder based on Maven. Apart from contract, it allows to load Maven settings from an XML file, configure remote repositories from an POM file and retrieve dependencies defined in a POM file, including ones in POM parents. Maven can be configured externally, using following properties:
MavenSettingsBuilder.ALT_USER_SETTINGS_XML_LOCATION
- a path to local settings.xml fileMavenSettingsBuilder.ALT_GLOBAL_SETTINGS_XML_LOCATION
- a path to global settings.xml fileMavenSettingsBuilder.ALT_LOCAL_REPOSITORY_LOCATION
- a path to local repositoryMavenSettingsBuilder.ALT_MAVEN_OFFLINE
- a flag to go offline
MavenSettingsBuilder
Constructor Summary | |
---|---|
MavenBuilderImpl()
Constructs new instance of MavenDependencies |
|
MavenBuilderImpl(MavenRepositorySystem system,
org.sonatype.aether.RepositorySystemSession session,
org.jboss.shrinkwrap.resolver.impl.maven.MavenDependencyResolverSettings settings,
Stack<MavenDependency> dependencies,
Set<MavenDependency> dependencyManagement)
|
Method Summary | ||
---|---|---|
MavenDependencyResolver |
artifact(String coordinates)
Creates an artifact builder. |
|
MavenDependencyResolver |
artifacts(String... coordinates)
Creates an artifact builder. |
|
MavenDependencyResolver |
configureFrom(String path)
Configures Maven from a settings.xml file |
|
MavenDependencyResolver |
exclusion(String coordinates)
Adds an exclusion for current dependency. |
|
MavenDependencyResolver |
exclusions(Collection<String> coordinates)
Adds multiple exclusions for current dependency |
|
MavenDependencyResolver |
exclusions(String... coordinates)
Adds multiple exclusions for current dependency |
|
Stack<MavenDependency> |
getDependencies()
Gets all the dependencies marked by Resolver to be resolved |
|
Set<MavenDependency> |
getVersionManagement()
Gets all the dependencies retrieved from metadata parsing. |
|
MavenDependencyResolver |
goOffline()
Disables touching remote repositories at all, rely on local repository only |
|
MavenDependencyResolver |
includeDependenciesFromPom(String path)
Loads dependencies from the specified path and applies the specified MavenResolutionFilter. |
|
MavenDependencyResolver |
loadDependenciesFromPom(String path)
Deprecated. please use includeDependenciesFromPom(String) instead |
|
MavenDependencyResolver |
loadDependenciesFromPom(String path,
MavenResolutionFilter filter)
Deprecated. please use includeDependenciesFromPom(String) instead |
|
MavenDependencyResolver |
loadMetadataFromPom(String path)
Loads remote repositories for a POM file. |
|
MavenDependencyResolver |
loadReposFromPom(String path)
Deprecated. please use loadMetadataFromPom(String) instead |
|
MavenDependencyResolver |
optional(boolean optional)
Sets dependency as optional. |
|
|
resolveAs(Class<ARCHIVEVIEW> archiveView)
Resolves dependencies for dependency builder |
|
|
resolveAs(Class<ARCHIVEVIEW> archiveView,
MavenResolutionFilter filter)
Resolves dependencies for dependency builder. |
|
File[] |
resolveAsFiles()
Resolves dependencies for dependency builder |
|
File[] |
resolveAsFiles(MavenResolutionFilter filter)
Resolves dependencies for dependency builder. |
|
MavenDependencyResolver |
scope(String scope)
Sets a scope of dependency |
|
MavenDependencyResolver |
useCentralRepo(boolean useCentral)
Sets the resolver to either consider (or not) Maven Central in resolution |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MavenBuilderImpl()
public MavenBuilderImpl(MavenRepositorySystem system, org.sonatype.aether.RepositorySystemSession session, org.jboss.shrinkwrap.resolver.impl.maven.MavenDependencyResolverSettings settings, Stack<MavenDependency> dependencies, Set<MavenDependency> dependencyManagement)
Method Detail |
---|
public Stack<MavenDependency> getDependencies()
public Set<MavenDependency> getVersionManagement()
MavenDependencyResolver
version metadatapublic MavenDependencyResolver configureFrom(String path)
path
- A path to a settings.xml configuration file
public MavenDependencyResolver loadMetadataFromPom(String path) throws ResolutionException
path
- A path to the POM file, must not be null
or empty
Exception
ResolutionException
@Deprecated public MavenDependencyResolver loadReposFromPom(String path) throws ResolutionException
loadMetadataFromPom(String)
instead
MavenDependencyResolver
path
- A path to the POM file, must not be null
or empty
ResolutionException
public MavenDependencyResolver includeDependenciesFromPom(String path) throws ResolutionException
path
- path to file which contains the desired dependenciesfilter
- the filter to apply
ResolutionException
- if any resolution related exceptions occur@Deprecated public MavenDependencyResolver loadDependenciesFromPom(String path) throws ResolutionException
includeDependenciesFromPom(String)
instead
MavenDependencyResolver
ResolutionException
@Deprecated public MavenDependencyResolver loadDependenciesFromPom(String path, MavenResolutionFilter filter) throws ResolutionException
includeDependenciesFromPom(String)
instead
MavenDependencyResolver
ResolutionException
public MavenDependencyResolver artifact(String coordinates) throws ResolutionException
DependencyBuilder
coordinates
- Coordinates specified to a created artifact, specified in an implementation-specific format.
DependencyBuilder
ResolutionException
- If artifact coordinates are wrong or if version cannot be determined.public MavenDependencyResolver artifacts(String... coordinates) throws ResolutionException
DependencyBuilder
coordinates
- A list of coordinates specified to the created artifacts, specified in an implementation-specific
format.
DependencyBuilder
ResolutionException
- If artifact coordinates are wrong or if version cannot be determined.public MavenDependencyResolver exclusion(String coordinates)
MavenDependencyResolver
coordinates
- the exclusion to be added to list of artifacts to be excluded, specified in the format
<groupId>:<artifactId>[:<extension>[:<classifier>]]
, an empty string or *
will match all
exclusions, you can pass an *
instead of any part of the coordinates to match all possible values
public MavenDependencyResolver exclusions(String... coordinates)
MavenDependencyResolver
coordinates
- the exclusions to be added to the list of artifacts to be excluded, specified in the format
<groupId>:<artifactId>[:<extension>[:<classifier>]]
, an empty string or *
will match all
exclusions, you can pass an *
instead of any part of the coordinates to match all possible values
public MavenDependencyResolver exclusions(Collection<String> coordinates)
MavenDependencyResolver
coordinates
- the exclusions to be added to the list of artifacts to be excluded, specified in the format
<groupId>:<artifactId>[:<extension>[:<classifier>]]
, an empty string or *
will match all
exclusions, you can pass an *
instead of any part of the coordinates to match all possible values
public MavenDependencyResolver optional(boolean optional)
MavenDependencyResolver
optional
flag
optional
- Optional flag
public MavenDependencyResolver scope(String scope)
MavenDependencyResolver
scope
- A scope, for example @{code compile}, @{code test} and others
public File[] resolveAsFiles() throws ResolutionException
DependencyResolver
ResolutionException
- If artifacts could not be resolvedpublic File[] resolveAsFiles(MavenResolutionFilter filter) throws ResolutionException
DependencyResolver
filter
- The filter to limit the dependencies during resolution
ResolutionException
public <ARCHIVEVIEW extends org.jboss.shrinkwrap.api.Assignable> Collection<ARCHIVEVIEW> resolveAs(Class<ARCHIVEVIEW> archiveView) throws ResolutionException
DependencyResolver
archiveView
- End-user view of the archive requested (ie. GenericArchive
or JavaArchive
)
ResolutionException
- If artifacts could not be resolvedpublic MavenDependencyResolver useCentralRepo(boolean useCentral)
useCentral
- a flag whether to use Maven central
MavenDependencyResolver.useCentralRepo(boolean)
public <ARCHIVEVIEW extends org.jboss.shrinkwrap.api.Assignable> Collection<ARCHIVEVIEW> resolveAs(Class<ARCHIVEVIEW> archiveView, MavenResolutionFilter filter) throws ResolutionException
DependencyResolver
archiveView
- End-user view of the archive requested (ie. GenericArchive
or JavaArchive
)filter
- The filter to limit the dependencies during resolution
ResolutionException
public MavenDependencyResolver goOffline()
MavenDependencyResolver
|
ShrinkWrap Resolver Aggregator 1.1.0-alpha-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |