Interface MavenArtifactPathResolver


public interface MavenArtifactPathResolver
Interface for an object that provides resolution of Maven artifacts and dependencies, emitting their paths.

This is abstracted such that the existing implementation can be easily changed in the future.

Since:
2.6.0
Author:
Ashley Scopes
  • Method Details

    • resolveArtifact

      Path resolveArtifact(MavenArtifact artifact) throws ResolutionException
      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

      List<Path> resolveDependencies(Collection<? extends MavenArtifact> artifacts, DependencyResolutionDepth defaultDependencyResolutionDepth, Set<String> dependencyScopes, boolean includeProjectDependencies, boolean failOnInvalidDependencies) 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.
      dependencyScopes - the allowed dependency scopes to resolve.
      includeProjectDependencies - whether to also resolve project dependencies and return them in the result.
      failOnInvalidDependencies - if false, resolution of invalid dependencies will result in errors being logged, but the build will not be halted.
      Returns:
      the paths to each resolved artifact.
      Throws:
      ResolutionException - if resolution failed in the backend.