Class FilterCliVersionResolver

java.lang.Object
software.amazon.smithy.cli.dependencies.FilterCliVersionResolver
All Implemented Interfaces:
DependencyResolver

public final class FilterCliVersionResolver extends Object implements DependencyResolver
Removes Smithy CLI dependencies that conflict with the JARs used by the CLI.

This makes creating a dedicated ClassLoader simpler because Smithy dependencies are provided by the parent class loader when running the CLI.

  • Constructor Details

    • FilterCliVersionResolver

      public FilterCliVersionResolver(String version, DependencyResolver delegate)
      Parameters:
      version - Version of the Smithy CLI.
      delegate - Resolver to resolve dependencies and filter.
  • Method Details

    • addRepository

      public void addRepository(MavenRepository repository)
      Description copied from interface: DependencyResolver
      Add a Maven repository.
      Specified by:
      addRepository in interface DependencyResolver
      Parameters:
      repository - Repository to add.
    • addDependency

      public void addDependency(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 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.