public class MavenBuilderImpl extends Object
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 offlineMavenSettingsBuilder
Constructor and Description |
---|
MavenBuilderImpl()
Constructs new instance of MavenDependencies
|
Modifier and Type | Method and Description |
---|---|
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() |
Map<org.jboss.shrinkwrap.resolver.impl.maven.ArtifactAsKey,MavenDependency> |
getPomInternalDependencyManagement() |
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.
|
<ARCHIVEVIEW extends org.jboss.shrinkwrap.api.Assignable> |
resolveAs(Class<ARCHIVEVIEW> archiveView)
Resolves dependencies for dependency builder
|
<ARCHIVEVIEW extends org.jboss.shrinkwrap.api.Assignable> |
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
|
public MavenBuilderImpl()
public Stack<MavenDependency> getDependencies()
public Map<org.jboss.shrinkwrap.resolver.impl.maven.ArtifactAsKey,MavenDependency> getPomInternalDependencyManagement()
public MavenDependencyResolver configureFrom(String path)
path
- A path to a settings.xml configuration filepublic MavenDependencyResolver loadMetadataFromPom(String path) throws ResolutionException
path
- A path to the POM file, must not be null
or emptyException
ResolutionException
@Deprecated public MavenDependencyResolver loadReposFromPom(String path) throws ResolutionException
loadMetadataFromPom(String)
insteadMavenDependencyResolver
path
- A path to the POM file, must not be null
or emptyResolutionException
public MavenDependencyResolver includeDependenciesFromPom(String path) throws ResolutionException
path
- path to file which contains the desired dependenciesfilter
- the filter to applyResolutionException
- if any resolution related exceptions occur@Deprecated public MavenDependencyResolver loadDependenciesFromPom(String path) throws ResolutionException
includeDependenciesFromPom(String)
insteadMavenDependencyResolver
ResolutionException
@Deprecated public MavenDependencyResolver loadDependenciesFromPom(String path, MavenResolutionFilter filter) throws ResolutionException
includeDependenciesFromPom(String)
insteadMavenDependencyResolver
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 valuespublic 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 valuespublic 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 valuespublic MavenDependencyResolver optional(boolean optional)
MavenDependencyResolver
optional
flagoptional
- Optional flagpublic MavenDependencyResolver scope(String scope)
MavenDependencyResolver
scope
- A scope, for example @{code compile}, @{code test} and otherspublic 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 resolutionResolutionException
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 centralMavenDependencyResolver.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 resolutionResolutionException
public MavenDependencyResolver goOffline()
MavenDependencyResolver
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.