Interface MavenDownloader

All Known Implementing Classes:
MavenDownloaderImpl

public interface MavenDownloader
Pragmatic Maven download/resolution API that should replace usage of Ivy/Grape and Shrinkwrap across Camel.
  • Method Details

    • resolveArtifacts

      List<MavenArtifact> resolveArtifacts(List<String> dependencyGAVs, Set<String> extraRepositories, boolean transitively, boolean useApacheSnapshots) throws MavenResolutionException
      Main resolution method. Using Maven Resolver, a list of maven coordinates (in the form of groupId:artifactId[:packaging[:classifier]]:version) is used to download artifacts from configured Maven repositories.
      Parameters:
      dependencyGAVs - a list of Maven coordinates
      extraRepositories - nullable list of additional repositories to use (except the discovered ones)
      transitively - whether to download/resolve dependencies transitively
      useApacheSnapshots - whether to include Apache Snapshots repository in the list of used repositories
      Throws:
      MavenResolutionException
    • resolveAvailableVersions

      List<MavenGav> resolveAvailableVersions(String groupId, String artifactId, String repository) throws MavenResolutionException
      Resolves available versions for groupId + artifactId from single remote repository.
      Parameters:
      groupId - groupId
      artifactId - artifactId
      repository - external repository to use (defaults to Maven Central if null)
      Throws:
      MavenResolutionException
    • customize

      MavenDownloader customize(String localRepository, int connectTimeout, int requestTimeout)
      Existing, configured MavenDownloader can be used as a template to create customized version which shares most of the configuration except underlying org.eclipse.aether.RepositorySystemSession, which can't be shared.
    • setRemoteArtifactDownloadListener

      void setRemoteArtifactDownloadListener(RemoteArtifactDownloadListener listener)
      To use a listener when downloading from remote repositories.