Class ResolverUtil
java.lang.Object
org.apache.maven.plugins.dependency.utils.ResolverUtil
Helper class for using Resolver API.
-
Constructor Summary
ConstructorDescriptionResolverUtil
(org.eclipse.aether.RepositorySystem repositorySystem, javax.inject.Provider<org.apache.maven.execution.MavenSession> mavenSessionProvider) -
Method Summary
Modifier and TypeMethodDescriptionCollection
<org.eclipse.aether.graph.Dependency> collectDependencies
(org.eclipse.aether.graph.Dependency root) Collects the transitive dependencies.org.eclipse.aether.artifact.Artifact
createArtifactFromParams
(ParamArtifact paramArtifact) Create an artifact based on configuration from Mojo.protected org.eclipse.aether.repository.RemoteRepository
prepareRemoteRepository
(String repository) List
<org.eclipse.aether.repository.RemoteRepository> remoteRepositories
(List<String> repositories) Prepare a remote repositories list for given descriptions.org.eclipse.aether.artifact.Artifact
resolveArtifact
(org.eclipse.aether.artifact.Artifact artifact, List<org.eclipse.aether.repository.RemoteRepository> repositories) Resolve given artifactList
<org.eclipse.aether.artifact.Artifact> resolveDependencies
(org.eclipse.aether.artifact.Artifact artifact, List<org.eclipse.aether.repository.RemoteRepository> repositories) Resolve transitive dependencies for artifact.
-
Constructor Details
-
ResolverUtil
@Inject public ResolverUtil(org.eclipse.aether.RepositorySystem repositorySystem, javax.inject.Provider<org.apache.maven.execution.MavenSession> mavenSessionProvider)
-
-
Method Details
-
collectDependencies
public Collection<org.eclipse.aether.graph.Dependency> collectDependencies(org.eclipse.aether.graph.Dependency root) throws org.eclipse.aether.collection.DependencyCollectionException Collects the transitive dependencies.- Parameters:
root
- a root dependency for collections- Returns:
- a resolved dependencies collections
- Throws:
org.eclipse.aether.collection.DependencyCollectionException
-
resolveArtifact
public org.eclipse.aether.artifact.Artifact resolveArtifact(org.eclipse.aether.artifact.Artifact artifact, List<org.eclipse.aether.repository.RemoteRepository> repositories) throws org.eclipse.aether.resolution.ArtifactResolutionException Resolve given artifact- Parameters:
artifact
- an artifact to resolverepositories
- remote repositories list- Returns:
- resolved artifact
- Throws:
org.eclipse.aether.resolution.ArtifactResolutionException
- If the artifact could not be resolved.
-
resolveDependencies
public List<org.eclipse.aether.artifact.Artifact> resolveDependencies(org.eclipse.aether.artifact.Artifact artifact, List<org.eclipse.aether.repository.RemoteRepository> repositories) throws org.eclipse.aether.resolution.DependencyResolutionException Resolve transitive dependencies for artifact.- Parameters:
artifact
- an artifact to resolverepositories
- remote repositories list- Returns:
- list of transitive dependencies for artifact
- Throws:
org.eclipse.aether.resolution.DependencyResolutionException
- If the dependency tree could not be built or any dependency artifact could not be resolved.
-
remoteRepositories
public List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories(List<String> repositories) Prepare a remote repositories list for given descriptions.- Parameters:
repositories
- remote repositories descriptions- Returns:
- a list of remote repositories
-
prepareRemoteRepository
-
createArtifactFromParams
Create an artifact based on configuration from Mojo.- Parameters:
paramArtifact
- an artifact configuration- Returns:
- new artifact
-