Class MavenDependencyResolver

  • All Implemented Interfaces:
    DependencyResolver

    public final class MavenDependencyResolver
    extends java.lang.Object
    implements DependencyResolver
    Resolves Maven dependencies for the Smithy CLI using Maven resolvers.
    • Constructor Detail

      • MavenDependencyResolver

        public MavenDependencyResolver()
      • MavenDependencyResolver

        public MavenDependencyResolver​(java.lang.String cacheLocation)
        Parameters:
        cacheLocation - Maven local cache location.
    • Method Detail

      • addDependency

        public void addDependency​(java.lang.String coordinates)
        Description copied from interface: DependencyResolver
        Add a dependency.

        Coordinates must be given a group ID, artifact ID, and version in the form of "groupId:artifactId:version". Coordinates support Maven dependency ranges. Coordinates do not support LATEST, SNAPSHOT, latest-release, latest.*, or Gradle style "+" syntax.

        Specified by:
        addDependency in interface DependencyResolver
        Parameters:
        coordinates - Dependency coordinates to add.
      • resolve

        public java.util.List<ResolvedArtifact> resolve()
        Description copied from interface: DependencyResolver
        Resolves artifacts for the configured dependencies.
        Specified by:
        resolve in interface DependencyResolver
        Returns:
        Returns the resolved artifacts, including file on disk and coordinates.