Class AetherMavenArtifactPathResolver
java.lang.Object
io.github.ascopes.protobufmavenplugin.dependencies.aether.AetherMavenArtifactPathResolver
Component that can resolve artifacts and dependencies from the Eclipse Aether dependency
resolution backend.
- Since:
- 2.0.3
- Author:
- Ashley Scopes
-
Constructor Summary
ConstructorDescriptionAetherMavenArtifactPathResolver
(org.apache.maven.execution.MavenSession mavenSession, org.eclipse.aether.RepositorySystem repositorySystem, org.apache.maven.artifact.handler.ArtifactHandler artifactHandler) -
Method Summary
Modifier and TypeMethodDescriptionresolveArtifact
(MavenArtifact artifact) Resolve a single Maven artifact directly, and do not resolve any transitive dependencies.resolveDependencies
(Collection<? extends MavenArtifact> artifacts, DependencyResolutionDepth defaultDependencyResolutionDepth, boolean includeProjectDependencies) Resolve all given dependencies based on their resolution depth semantics.
-
Constructor Details
-
AetherMavenArtifactPathResolver
@Inject public AetherMavenArtifactPathResolver(org.apache.maven.execution.MavenSession mavenSession, org.eclipse.aether.RepositorySystem repositorySystem, org.apache.maven.artifact.handler.ArtifactHandler artifactHandler)
-
-
Method Details
-
resolveArtifact
Resolve a single Maven artifact directly, and do not resolve any transitive dependencies.- Parameters:
artifact
- the artifact to resolve.- Returns:
- the path to the resolved artifact.
- Throws:
ResolutionException
- if resolution fails in the backend.
-
resolveDependencies
public Collection<Path> resolveDependencies(Collection<? extends MavenArtifact> artifacts, DependencyResolutionDepth defaultDependencyResolutionDepth, boolean includeProjectDependencies) throws ResolutionException Resolve all given dependencies based on their resolution depth semantics.- Parameters:
artifacts
- the artifacts to resolve.defaultDependencyResolutionDepth
- the project default dependency resolution depth.includeProjectDependencies
- whether to also resolve project dependencies and return them in the result.- Returns:
- the paths to each resolved artifact.
- Throws:
ResolutionException
- if resolution failed in the backend.
-