Interface Session
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncollectDependencies
(Artifact artifact, PathScope scope) Shortcut forgetService(DependencyResolver.class).collect(...)
collectDependencies
(DependencyCoordinates dependency, PathScope scope) Collects the transitive dependencies of some artifacts and builds a dependency graph.collectDependencies
(Project project, PathScope scope) Shortcut forgetService(DependencyResolver.class).collect(...)
createArtifact
(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactFactory.class).create(...)
.createArtifact
(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactFactory.class).create(...)
.createArtifactCoordinates
(String coordsString) Creates a coordinates out of string that is formatted like:<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
.createArtifactCoordinates
(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactFactory.class).create(...)
.createArtifactCoordinates
(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactFactory.class).create(...)
.createArtifactCoordinates
(Artifact artifact) Shortcut forgetService(ArtifactFactory.class).create(...)
.createDependencyCoordinates
(ArtifactCoordinates coordinates) Shortcut forgetService(DependencyFactory.class).create(...)
.createDependencyCoordinates
(Dependency dependency) Shortcut forgetService(DependencyFactory.class).create(...)
.createLocalRepository
(Path path) Shortcut forgetService(RepositoryFactory.class).createLocal(...)
.createProducedArtifact
(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactFactory.class).createProduced(...)
.createProducedArtifact
(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactFactory.class).createProduced(...)
.createRemoteRepository
(String id, String url) Shortcut forgetService(RepositoryFactory.class).createRemote(...)
.createRemoteRepository
(Repository repository) Shortcut forgetService(RepositoryFactory.class).createRemote(...)
.void
deployArtifact
(RemoteRepository repository, Artifact... artifacts) Shortcut forgetService(ArtifactDeployer.class).deploy(...)
.flattenDependencies
(Node node, PathScope scope) Shortcut forgetService(DependencyResolver.class).flatten(...)
.getArtifactPath
(Artifact artifact) Shortcut forgetService(ArtifactManager.class).getPath(...)
.getData()
Retrieves the session data associated with this session.int
Returns the degree of concurrency for the build.getEffectiveProperties
(Project project) Each invocation computes a new map of effective properties.Returns the list of registered listeners.Retrieves the local repository associated with this session.Returns the current maven version.getPathForLocalArtifact
(Artifact artifact) Gets the relative path for a locally installed artifact.getPathForRemoteArtifact
(RemoteRepository remote, Artifact artifact) Gets the relative path for an artifact cached from a remote repository.getPluginContext
(Project project) Returns the plugin context for mojo being executed and the specifiedProject
, never returnsnull
as if context not present, creates it.Retrieves a list of projects associated with the session.Retrieves a list of remote repositories associated with this session.Gets the root directory of the session, which is the root directory for the top directory project.<T extends Service>
TgetService
(Class<T> clazz) Retrieves the service for the interfaceRetrieves the settings for the current session.Returns the start time of the session.Returns immutable system properties to use for interpolation.Gets the directory of the topmost project being built, usually the current directory or the directory pointed at by the-f/--file
command line argument.Returns immutable user properties to use for interpolation.void
installArtifacts
(Collection<Artifact> artifacts) Shortcut forgetService(ArtifactInstaller.class).install(...)
.void
installArtifacts
(Artifact... artifacts) Shortcut forgetService(ArtifactInstaller.class).install(...)
.boolean
isVersionSnapshot
(String version) Checks whether a given artifact version is considered aSNAPSHOT
or not.parseVersion
(String version) Parses the specified version string, for example "1.0".parseVersionConstraint
(String versionConstraint) Parses the specified version constraint specification, for example "1.0" or "[1.0,2.0)".parseVersionRange
(String versionRange) Parses the specified version range specification, for example "[1.0,2.0)".void
registerListener
(Listener listener) Register the given listener which will receive all events.Obtain theDependencyScope
from the specifiedid
.Obtain theLanguage
from the specifiedid
.Obtain thePackaging
from the specifiedid
.Obtain thePathScope
from the specifiedid
.Obtain theProjectScope
from the specifiedid
.requireType
(String id) Obtain theType
from the specifiedid
.resolveArtifact
(Artifact artifact) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.resolveArtifact
(ArtifactCoordinates coordinates) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.resolveArtifact
(ArtifactCoordinates coordinates, List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.resolveArtifact
(Artifact artifact, List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.resolveArtifacts
(Collection<? extends ArtifactCoordinates> coordinates) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.resolveArtifacts
(Collection<? extends ArtifactCoordinates> coordinates, List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.resolveArtifacts
(Artifact... artifacts) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.resolveArtifacts
(ArtifactCoordinates... coordinates) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.resolveDependencies
(List<DependencyCoordinates> dependencyCoordinates) Shortcut forgetService(DependencyResolver.class).resolve(...).getPaths()
.resolveDependencies
(DependencyCoordinates dependencyCoordinates) Shortcut forgetService(DependencyResolver.class).resolve(...).getPaths()
.resolveDependencies
(DependencyCoordinates dependencyCoordinates, PathScope scope, Collection<PathType> desiredTypes) Shortcut forgetService(DependencyResolver.class).resolve(...).getDispatchedPaths()
.resolveDependencies
(Project project, PathScope scope) Shortcut forgetService(DependencyResolver.class).resolve(...).getPaths()
.resolveDependencies
(Project project, PathScope scope, Collection<PathType> desiredTypes) Shortcut forgetService(DependencyResolver.class).resolve(...).getDispatchedPaths()
.resolveVersion
(ArtifactCoordinates artifact) Resolves an artifact's meta version (if any) to a concrete version.resolveVersionRange
(ArtifactCoordinates artifact) Expands a version range to a list of matching versions, in ascending order.resolveVersionRange
(ArtifactCoordinates artifact, List<RemoteRepository> repositories) Expands a version range to a list of matching versions, in ascending order.void
setArtifactPath
(ProducedArtifact artifact, Path path) Shortcut forgetService(ArtifactManager.class).setPath(...)
.void
unregisterListener
(Listener listener) Unregisters a previously registered listener.withLocalRepository
(LocalRepository localRepository) Creates a derived session using the given local repository.withRemoteRepositories
(List<RemoteRepository> repositories) Creates a derived session using the given remote repositories.
-
Method Details
-
getSettings
Retrieves the settings for the current session.- Returns:
- the settings instance
-
getLocalRepository
Retrieves the local repository associated with this session.- Returns:
- the local repository instance
-
getRemoteRepositories
Retrieves a list of remote repositories associated with this session.- Returns:
- a list of remote repositories
-
getData
Retrieves the session data associated with this session.- Returns:
- the session data, never
null
-
getUserProperties
Returns immutable user properties to use for interpolation. The user properties have been configured directly by the user, e.g. via the-Dkey=value
parameter on the command line.- Returns:
- the user properties, never
null
-
getSystemProperties
Returns immutable system properties to use for interpolation. The system properties are collected from the runtime environment such asSystem.getProperties()
and environment variables (prefixed withenv.
).- Returns:
- the system properties, never
null
-
getEffectiveProperties
Each invocation computes a new map of effective properties. To be used in interpolation.Effective properties are computed from system, user and optionally project properties, layered with defined precedence onto each other to achieve proper precedence. Precedence is defined as:
- System properties (lowest precedence)
- Project properties (optional)
- User properties (highest precedence)
profile > project
, hence active profile property may override project property.The caller of this method should decide whether there is a project in scope (hence, a project instance needs to be passed) or not.
- Parameters:
project
-Project
ornull
.- Returns:
- the effective properties, never
null
-
getMavenVersion
Returns the current maven version.- Returns:
- the maven version, never
null
-
getDegreeOfConcurrency
int getDegreeOfConcurrency()Returns the degree of concurrency for the build.- Returns:
- the degree of concurrency
-
getStartTime
Returns the start time of the session.- Returns:
- the start time as an Instant object, never
null
-
getTopDirectory
Gets the directory of the topmost project being built, usually the current directory or the directory pointed at by the-f/--file
command line argument.- Returns:
- the directory of the topmost project, never
null
- See Also:
-
getRootDirectory
Gets the root directory of the session, which is the root directory for the top directory project.- Returns:
- the root directory, never
null
- Throws:
IllegalStateException
- if the root directory could not be found- See Also:
-
getProjects
Retrieves a list of projects associated with the session.- Returns:
- a list of projects, never
null
-
getPluginContext
Returns the plugin context for mojo being executed and the specifiedProject
, never returnsnull
as if context not present, creates it. Implementation note: while this method return type isMap
, the returned map instance implementsConcurrentMap
as well.- Throws:
MavenException
- if not called from the within a mojo execution
-
getService
Retrieves the service for the interface- Throws:
NoSuchElementException
- if the service could not be found
-
withLocalRepository
Creates a derived session using the given local repository.- Parameters:
localRepository
- the new local repository- Returns:
- the derived session
- Throws:
NullPointerException
- iflocalRepository
is null
-
withRemoteRepositories
Creates a derived session using the given remote repositories.- Parameters:
repositories
- the new list of remote repositories- Returns:
- the derived session
- Throws:
NullPointerException
- ifrepositories
is null
-
registerListener
Register the given listener which will receive all events.- Parameters:
listener
- the listener to register- Throws:
NullPointerException
- iflistener
is null
-
unregisterListener
Unregisters a previously registered listener.- Parameters:
listener
- the listener to unregister- Throws:
NullPointerException
- iflistener
is null
-
getListeners
Returns the list of registered listeners.- Returns:
- an immutable collection of listeners, never
null
-
createLocalRepository
Shortcut forgetService(RepositoryFactory.class).createLocal(...)
.- Parameters:
path
- location of the local repository to create- Returns:
- cache of artifacts downloaded from a remote repository or built locally
- See Also:
-
createRemoteRepository
Shortcut forgetService(RepositoryFactory.class).createRemote(...)
.- Parameters:
id
- identifier of the remote repository to createurl
- location of the remote repository- Returns:
- remote repository that can be used to download or upload artifacts
- See Also:
-
createRemoteRepository
Shortcut forgetService(RepositoryFactory.class).createRemote(...)
.- Parameters:
repository
- information needed for establishing connections with remote repository- Returns:
- remote repository that can be used to download or upload artifacts
- See Also:
-
createArtifactCoordinates
Creates a coordinates out of string that is formatted like:<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
.Shortcut for
getService(ArtifactFactory.class).create(...)
.- Parameters:
coordsString
- the string having "standard" coordinates.- Returns:
- coordinates used to point to the artifact
- See Also:
-
createArtifactCoordinates
@Nonnull ArtifactCoordinates createArtifactCoordinates(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactFactory.class).create(...)
.- Parameters:
groupId
- the group identifier, ornull
is unspecifiedartifactId
- the artifact identifier, ornull
is unspecifiedversion
- the artifact version, ornull
is unspecifiedextension
- the artifact extension, ornull
is unspecified- Returns:
- coordinates used to point to the artifact
- See Also:
-
createArtifactCoordinates
@Nonnull ArtifactCoordinates createArtifactCoordinates(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactFactory.class).create(...)
.- Parameters:
groupId
- the group identifier, ornull
is unspecifiedartifactId
- the artifact identifier, ornull
is unspecifiedversion
- the artifact version, ornull
is unspecifiedclassifier
- the artifact classifier, ornull
is unspecifiedextension
- the artifact extension, ornull
is unspecifiedtype
- the artifact type, ornull
is unspecified- Returns:
- coordinates used to point to the artifact
- See Also:
-
createArtifactCoordinates
Shortcut forgetService(ArtifactFactory.class).create(...)
.- Parameters:
artifact
- artifact from which to get coordinates- Returns:
- coordinates used to point to the artifact
- See Also:
-
createDependencyCoordinates
@Nonnull DependencyCoordinates createDependencyCoordinates(@Nonnull ArtifactCoordinates coordinates) Shortcut forgetService(DependencyFactory.class).create(...)
.- Parameters:
coordinates
- artifact coordinates to get as a dependency coordinates- Returns:
- dependency coordinates for the given artifact
- See Also:
-
createDependencyCoordinates
Shortcut forgetService(DependencyFactory.class).create(...)
.- Parameters:
dependency
- dependency for which to get the coordinates- Returns:
- coordinates for the given dependency
- See Also:
-
createArtifact
@Nonnull Artifact createArtifact(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactFactory.class).create(...)
.- Parameters:
groupId
- the group identifier, ornull
is unspecifiedartifactId
- the artifact identifier, ornull
is unspecifiedversion
- the artifact version, ornull
is unspecifiedextension
- the artifact extension, ornull
is unspecified- Returns:
- artifact with the given coordinates
- See Also:
-
createArtifact
@Nonnull Artifact createArtifact(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactFactory.class).create(...)
.- Parameters:
groupId
- the group identifier, ornull
is unspecifiedartifactId
- the artifact identifier, ornull
is unspecifiedversion
- the artifact version, ornull
is unspecifiedclassifier
- the artifact classifier, ornull
is unspecifiedextension
- the artifact extension, ornull
is unspecifiedtype
- the artifact type, ornull
is unspecified- Returns:
- artifact with the given coordinates
- See Also:
-
createProducedArtifact
@Nonnull ProducedArtifact createProducedArtifact(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactFactory.class).createProduced(...)
.- Parameters:
groupId
- the group identifier, ornull
is unspecifiedartifactId
- the artifact identifier, ornull
is unspecifiedversion
- the artifact version, ornull
is unspecifiedextension
- the artifact extension, ornull
is unspecified- Returns:
- artifact with the given coordinates
- See Also:
-
createProducedArtifact
@Nonnull ProducedArtifact createProducedArtifact(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactFactory.class).createProduced(...)
.- Parameters:
groupId
- the group identifier, ornull
is unspecifiedartifactId
- the artifact identifier, ornull
is unspecifiedversion
- the artifact version, ornull
is unspecifiedclassifier
- the artifact classifier, ornull
is unspecifiedextension
- the artifact extension, ornull
is unspecifiedtype
- the artifact type, ornull
is unspecified- Returns:
- artifact with the given coordinates
- See Also:
-
resolveArtifact
Shortcut forgetService(ArtifactResolver.class).resolve(...)
.- Parameters:
coordinates
- coordinates of the artifact to resolve- Returns:
- requested artifact together with the path to its file
- Throws:
ArtifactResolverException
- if the artifact resolution failed- See Also:
-
resolveArtifact
@Nonnull DownloadedArtifact resolveArtifact(@Nonnull ArtifactCoordinates coordinates, List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.- Parameters:
coordinates
- coordinates of the artifact to resolverepositories
- repositories to use, ifnull
, the session repositories are used- Returns:
- requested artifact together with the path to its file
- Throws:
ArtifactResolverException
- if the artifact resolution failed- See Also:
-
resolveArtifacts
@Nonnull Collection<DownloadedArtifact> resolveArtifacts(@Nonnull ArtifactCoordinates... coordinates) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.- Parameters:
coordinates
- coordinates of all artifacts to resolve- Returns:
- requested artifacts together with the paths to their files
- Throws:
ArtifactResolverException
- if the artifact resolution failed- See Also:
-
resolveArtifacts
@Nonnull Collection<DownloadedArtifact> resolveArtifacts(@Nonnull Collection<? extends ArtifactCoordinates> coordinates) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.- Parameters:
coordinates
- coordinates of all artifacts to resolve- Returns:
- requested artifacts together with the paths to their files
- Throws:
ArtifactResolverException
- if the artifact resolution failed- See Also:
-
resolveArtifacts
@Nonnull Collection<DownloadedArtifact> resolveArtifacts(@Nonnull Collection<? extends ArtifactCoordinates> coordinates, @Nullable List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.- Parameters:
coordinates
- coordinates of all artifacts to resolverepositories
- repositories to use, ifnull
, the session repositories are used- Returns:
- requested artifacts together with the paths to their files
- Throws:
ArtifactResolverException
- if the artifact resolution failed- See Also:
-
resolveArtifact
Shortcut forgetService(ArtifactResolver.class).resolve(...)
.- Parameters:
artifact
- the artifact to resolve- Returns:
- requested artifact together with the path to its file
- Throws:
ArtifactResolverException
- if the artifact resolution failed- See Also:
-
resolveArtifact
@Nonnull DownloadedArtifact resolveArtifact(@Nonnull Artifact artifact, @Nullable List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)
.- Parameters:
artifact
- the artifact to resolverepositories
- repositories to use, ifnull
, the session repositories are used- Returns:
- requested artifact together with the path to its file
- Throws:
ArtifactResolverException
- if the artifact resolution failed- See Also:
-
resolveArtifacts
Shortcut forgetService(ArtifactResolver.class).resolve(...)
.- Parameters:
artifacts
- all artifacts to resolve- Returns:
- requested artifacts together with the paths to their files
- Throws:
ArtifactResolverException
- if the artifact resolution failed- See Also:
-
installArtifacts
Shortcut forgetService(ArtifactInstaller.class).install(...)
.- Parameters:
artifacts
- the artifacts to install- Throws:
ArtifactInstallerException
- if the artifacts installation failed- See Also:
-
installArtifacts
Shortcut forgetService(ArtifactInstaller.class).install(...)
.- Parameters:
artifacts
- the artifacts to install- Throws:
ArtifactInstallerException
- if the artifacts installation failed- See Also:
-
deployArtifact
Shortcut forgetService(ArtifactDeployer.class).deploy(...)
.- Parameters:
repository
- the repository where to deploy artifactsartifacts
- the artifacts to deploy- Throws:
ArtifactDeployerException
- if the artifacts deployment failed- See Also:
-
setArtifactPath
Shortcut forgetService(ArtifactManager.class).setPath(...)
.- Parameters:
artifact
- the artifact for which to associate a pathpath
- path to associate to the given artifact- See Also:
-
getArtifactPath
Shortcut forgetService(ArtifactManager.class).getPath(...)
.- Parameters:
artifact
- the artifact for which to get a path- Returns:
- path associated to the given artifact
- See Also:
-
getPathForLocalArtifact
Gets the relative path for a locally installed artifact. Note that the artifact need not actually exist yet at the returned location, the path merely indicates where the artifact would eventually be stored.Shortcut for
getService(LocalArtifactManager.class).getPathForLocalArtitact(...)
.- Parameters:
artifact
- the artifact for which to get a local path- Returns:
- local path associated to the given artifact, or
null
if none - See Also:
-
getPathForRemoteArtifact
@Nonnull Path getPathForRemoteArtifact(@Nonnull RemoteRepository remote, @Nonnull Artifact artifact) Gets the relative path for an artifact cached from a remote repository. Note that the artifact need not actually exist yet at the returned location, the path merely indicates where the artifact would eventually be stored.Shortcut for
getService(LocalArtifactManager.class).getPathForRemoteArtifact(...)
.- Parameters:
remote
- the repository from where artifacts are downloadedartifact
- the artifact for which to get a path- Returns:
- path associated to the given artifact
- See Also:
-
isVersionSnapshot
Checks whether a given artifact version is considered aSNAPSHOT
or not.Shortcut for
getService(ArtifactManager.class).isSnapshot(...)
.In case there is
Artifact
in scope, the recommended way to perform this check is use ofArtifact.isSnapshot()
instead.- Parameters:
version
- artifact version- Returns:
- whether the given version is a snapshot
- See Also:
-
collectDependencies
Shortcut forgetService(DependencyResolver.class).collect(...)
- Parameters:
artifact
- artifact for which to get the dependencies, including transitive onesscope
- the {link PathScope} to collect dependencies, must not benull
- Returns:
- root node of the dependency graph for the given artifact
- Throws:
DependencyResolverException
- if the dependency collection failed- See Also:
-
collectDependencies
Shortcut forgetService(DependencyResolver.class).collect(...)
- Parameters:
project
- project for which to get the dependencies, including transitive onesscope
- the {link PathScope} to collect dependencies, must not benull
- Returns:
- root node of the dependency graph for the given project
- Throws:
DependencyResolverException
- if the dependency collection failed- See Also:
-
collectDependencies
@Nonnull Node collectDependencies(@Nonnull DependencyCoordinates dependency, @Nonnull PathScope scope) Collects the transitive dependencies of some artifacts and builds a dependency graph. Note that this operation is only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the artifact files.Shortcut for
getService(DependencyResolver.class).resolve(...)
- Parameters:
dependency
- dependency for which to get transitive dependenciesscope
- the {link PathScope} to collect dependencies, must not benull
- Returns:
- root node of the dependency graph for the given artifact
- Throws:
DependencyResolverException
- if the dependency collection failed- See Also:
-
flattenDependencies
Shortcut forgetService(DependencyResolver.class).flatten(...)
.- Parameters:
node
- node for which to get a flattened listscope
- build path scope (main compile, test compile, etc.) of desired nodes- Returns:
- flattened list of node with the given build path scope
- Throws:
DependencyResolverException
- if the dependency flattening failed- See Also:
-
resolveDependencies
Shortcut forgetService(DependencyResolver.class).resolve(...).getPaths()
.- Parameters:
dependencyCoordinates
- coordinates of the dependency for which to get the paths- Returns:
- paths to the transitive dependencies of the given dependency
- See Also:
-
resolveDependencies
Shortcut forgetService(DependencyResolver.class).resolve(...).getPaths()
.- Parameters:
dependencyCoordinates
- coordinates of all dependency for which to get the paths- Returns:
- paths to the transitive dependencies of the given dependencies
- See Also:
-
resolveDependencies
Shortcut forgetService(DependencyResolver.class).resolve(...).getPaths()
.- Parameters:
project
- the project for which to get dependenciesscope
- build path scope (main compile, test compile, etc.) of desired paths- Returns:
- paths to the transitive dependencies of the given project
- See Also:
-
resolveDependencies
@Nonnull Map<PathType,List<Path>> resolveDependencies(@Nonnull DependencyCoordinates dependencyCoordinates, @Nonnull PathScope scope, @Nonnull Collection<PathType> desiredTypes) Shortcut forgetService(DependencyResolver.class).resolve(...).getDispatchedPaths()
.- Parameters:
dependencyCoordinates
- coordinates of the dependency for which to get the pathsscope
- build path scope (main compile, test compile, etc.) of desired pathsdesiredTypes
- the type of paths to include in the result- Returns:
- paths to the transitive dependencies of the given project
- See Also:
-
resolveDependencies
@Nonnull Map<PathType,List<Path>> resolveDependencies(@Nonnull Project project, @Nonnull PathScope scope, @Nonnull Collection<PathType> desiredTypes) Shortcut forgetService(DependencyResolver.class).resolve(...).getDispatchedPaths()
.- Parameters:
project
- the project for which to get dependenciesscope
- build path scope (main compile, test compile, etc.) of desired pathsdesiredTypes
- the type of paths to include in the result- Returns:
- paths to the transitive dependencies of the given project
- See Also:
-
resolveVersion
Resolves an artifact's meta version (if any) to a concrete version. For example, resolves "1.0-SNAPSHOT" to "1.0-20090208.132618-23".Shortcut for
getService(VersionResolver.class).resolve(...)
- Parameters:
artifact
- the artifact for which to resolve the version- Returns:
- resolved version of the given artifact
- Throws:
VersionResolverException
- if the resolution failed- See Also:
-
resolveVersionRange
Expands a version range to a list of matching versions, in ascending order. For example, resolves "[3.8,4.0)" to "3.8", "3.8.1", "3.8.2". The returned list of versions is only dependent on the configured repositories and their contents. The supplied request may also refer to a single concrete version rather than a version range. In this case though, the result contains simply the (parsed) input version, regardless of the repositories and their contents.- Parameters:
artifact
- the artifact for which to resolve the versions- Returns:
- a list of resolved
Version
s. - Throws:
VersionRangeResolverException
- if the resolution failed- See Also:
-
resolveVersionRange
@Nonnull List<Version> resolveVersionRange(@Nonnull ArtifactCoordinates artifact, List<RemoteRepository> repositories) Expands a version range to a list of matching versions, in ascending order. For example, resolves "[3.8,4.0)" to "3.8", "3.8.1", "3.8.2". The returned list of versions is only dependent on the configured repositories and their contents. The supplied request may also refer to a single concrete version rather than a version range. In this case though, the result contains simply the (parsed) input version, regardless of the repositories and their contents.- Parameters:
artifact
- the artifact for which to resolve the versionsrepositories
- the repositories to use, or the session repositories ifnull
- Returns:
- a list of resolved
Version
s. - Throws:
VersionRangeResolverException
- if the resolution failed- See Also:
-
parseVersion
Parses the specified version string, for example "1.0".Shortcut for
getService(VersionParser.class).parseVersion(...)
.- Parameters:
version
- the version string to parse- Returns:
- the version parsed from the given string
- Throws:
VersionParserException
- if the parsing failed- See Also:
-
parseVersionRange
Parses the specified version range specification, for example "[1.0,2.0)".Shortcut for
getService(VersionParser.class).parseVersionRange(...)
.- Parameters:
versionRange
- the version string to parse- Returns:
- the version range parsed from the given string
- Throws:
VersionParserException
- if the parsing failed- See Also:
-
parseVersionConstraint
Parses the specified version constraint specification, for example "1.0" or "[1.0,2.0)".Shortcut for
getService(VersionParser.class).parseVersionConstraint(...)
.- Parameters:
versionConstraint
- the version string to parse- Returns:
- the version constraint parsed from the given string
- Throws:
VersionParserException
- if the parsing failed- See Also:
-
requireType
- See Also:
-
requireLanguage
Obtain theLanguage
from the specifiedid
.Shortcut for
getService(LanguageRegistry.class).require(...)
.- See Also:
-
requirePackaging
Obtain thePackaging
from the specifiedid
.Shortcut for
getService(PackagingRegistry.class).require(...)
.- See Also:
-
requireProjectScope
Obtain theProjectScope
from the specifiedid
.Shortcut for
getService(ProjectScopeRegistry.class).require(...)
.- See Also:
-
requireDependencyScope
- See Also:
-
requirePathScope
Obtain thePathScope
from the specifiedid
.Shortcut for
getService(PathScopeRegistry.class).require(...)
.- See Also:
-