public class DependencyResolver extends Object
Dependency
s resolutions for Maven Artifact
based on RepositorySystem
and
RepositorySystemSession
from Eclipse Aether.Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
DependencyResolver(MavenConfiguration mavenConfiguration,
Optional<org.eclipse.aether.repository.WorkspaceReader> workspaceReader)
Creates an instance of the resolver.
|
Modifier and Type | Method and Description |
---|---|
List<org.eclipse.aether.graph.Dependency> |
getDirectDependencies(org.eclipse.aether.artifact.Artifact artifact)
Resolves direct dependencies for an
Artifact . |
List<org.eclipse.aether.graph.Dependency> |
getDirectDependencies(org.eclipse.aether.artifact.Artifact artifact,
List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories)
Resolves direct dependencies for an
Artifact . |
org.eclipse.aether.resolution.ArtifactDescriptorResult |
readArtifactDescriptor(org.eclipse.aether.artifact.Artifact artifact)
Gets information about an artifact like its direct dependencies and potential relocations.
|
org.eclipse.aether.resolution.ArtifactDescriptorResult |
readArtifactDescriptor(org.eclipse.aether.artifact.Artifact artifact,
List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories)
Gets information about an artifact like its direct dependencies and potential relocations.
|
org.eclipse.aether.resolution.ArtifactResult |
resolveArtifact(org.eclipse.aether.artifact.Artifact artifact)
Resolves the path for an artifact.
|
org.eclipse.aether.resolution.ArtifactResult |
resolveArtifact(org.eclipse.aether.artifact.Artifact artifact,
List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories)
Resolves the path for an artifact.
|
List<File> |
resolveDependencies(org.eclipse.aether.graph.Dependency root,
List<org.eclipse.aether.graph.Dependency> directDependencies,
List<org.eclipse.aether.graph.Dependency> managedDependencies,
org.eclipse.aether.graph.DependencyFilter dependencyFilter,
List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories)
Resolves and filters transitive dependencies for the root and direct dependencies.
|
public DependencyResolver(MavenConfiguration mavenConfiguration, Optional<org.eclipse.aether.repository.WorkspaceReader> workspaceReader)
mavenConfiguration
- MavenConfiguration
that defines the configuration to be used by Aether.workspaceReader
- WorkspaceReader
used to resolve dependencies
within the workspace.public org.eclipse.aether.resolution.ArtifactDescriptorResult readArtifactDescriptor(org.eclipse.aether.artifact.Artifact artifact) throws org.eclipse.aether.resolution.ArtifactDescriptorException
artifact
- the Artifact
requested, must not be null
ArtifactDescriptorResult
descriptor result, never null
{@link
- ArtifactDescriptorException} if the artifact descriptor could not be readorg.eclipse.aether.resolution.ArtifactDescriptorException
public org.eclipse.aether.resolution.ArtifactDescriptorResult readArtifactDescriptor(org.eclipse.aether.artifact.Artifact artifact, List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories) throws org.eclipse.aether.resolution.ArtifactDescriptorException
artifact
- the Artifact
requested, must not be null
remoteRepositories
- to be used for resolving the artifact in addition to the ones already defined in context.ArtifactDescriptorResult
descriptor result, never null
{@link
- ArtifactDescriptorException} if the artifact descriptor could not be readorg.eclipse.aether.resolution.ArtifactDescriptorException
public org.eclipse.aether.resolution.ArtifactResult resolveArtifact(org.eclipse.aether.artifact.Artifact artifact) throws org.eclipse.aether.resolution.ArtifactResolutionException
artifact
- the Artifact
requested, must not be null
null
.{@link
- ArtifactResolutionException} if the artifact could not be resolved.org.eclipse.aether.resolution.ArtifactResolutionException
public org.eclipse.aether.resolution.ArtifactResult resolveArtifact(org.eclipse.aether.artifact.Artifact artifact, List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories) throws org.eclipse.aether.resolution.ArtifactResolutionException
artifact
- the Artifact
requested, must not be null
remoteRepositories
- remote repositories to be used in addition to the one in contextnull
.{@link
- ArtifactResolutionException} if the artifact could not be resolved.org.eclipse.aether.resolution.ArtifactResolutionException
public List<org.eclipse.aether.graph.Dependency> getDirectDependencies(org.eclipse.aether.artifact.Artifact artifact) throws org.eclipse.aether.resolution.ArtifactDescriptorException
Artifact
.artifact
- Artifact
to collect its direct dependenciesList
of Dependency
for each direct dependency resolved{@link
- ArtifactDescriptorException} if the artifact descriptor could not be readorg.eclipse.aether.resolution.ArtifactDescriptorException
public List<org.eclipse.aether.graph.Dependency> getDirectDependencies(org.eclipse.aether.artifact.Artifact artifact, List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories) throws org.eclipse.aether.resolution.ArtifactDescriptorException
Artifact
.artifact
- Artifact
to collect its direct dependenciesremoteRepositories
- remote repositories to be used in addition to the one in contextList
of Dependency
for each direct dependency resolved{@link
- ArtifactDescriptorException} if the artifact descriptor could not be readorg.eclipse.aether.resolution.ArtifactDescriptorException
public List<File> resolveDependencies(org.eclipse.aether.graph.Dependency root, List<org.eclipse.aether.graph.Dependency> directDependencies, List<org.eclipse.aether.graph.Dependency> managedDependencies, org.eclipse.aether.graph.DependencyFilter dependencyFilter, List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories) throws org.eclipse.aether.collection.DependencyCollectionException, org.eclipse.aether.resolution.DependencyResolutionException
root
- Dependency
node from to collect its dependencies, may be null
directDependencies
- List
of direct Dependency
to collect its transitive dependencies, may be
null
managedDependencies
- List
of managed Dependency
s to be used for resolving the depedency graph, may be
null
dependencyFilter
- DependencyFilter
to include/exclude dependency nodes during collection and resolve operation.
May be null
to no filterremoteRepositories
- RemoteRepository
to be used when resolving dependencies in addition to the ones already defined in the context.List
of File
s for each dependency resolved{@link
- DependencyCollectionException} if the dependency tree could not be builtorg.eclipse.aether.collection.DependencyCollectionException
org.eclipse.aether.resolution.DependencyResolutionException
Copyright © 2018. All rights reserved.