Interface DependencyResolver
-
- All Known Implementing Classes:
FileCacheResolver
,FilterCliVersionResolver
,MavenDependencyResolver
public interface DependencyResolver
Resolves Maven dependencies for the Smithy CLI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
DependencyResolver.Factory
Responsible for creating aDependencyResolver
for the CLI, optionally based on configuration.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addDependency(java.lang.String coordinates)
Add a dependency.void
addRepository(MavenRepository repository)
Add a Maven repository.java.util.List<ResolvedArtifact>
resolve()
Resolves artifacts for the configured dependencies.
-
-
-
Method Detail
-
addRepository
void addRepository(MavenRepository repository)
Add a Maven repository.- Parameters:
repository
- Repository to add.- Throws:
DependencyResolverException
- When the repository is invalid.
-
addDependency
void addDependency(java.lang.String coordinates)
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.
- Parameters:
coordinates
- Dependency coordinates to add.- Throws:
DependencyResolverException
- When the dependency is invalid.
-
resolve
java.util.List<ResolvedArtifact> resolve()
Resolves artifacts for the configured dependencies.- Returns:
- Returns the resolved artifacts, including file on disk and coordinates.
- Throws:
DependencyResolverException
- If dependency resolution fails.
-
-