Interface DependencyDownloader

All Superinterfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.spi.HasCamelContext, org.apache.camel.Service, org.apache.camel.StaticService
All Known Implementing Classes:
MavenDependencyDownloader

public interface DependencyDownloader extends org.apache.camel.CamelContextAware, org.apache.camel.StaticService
To download dependencies at runtime.
  • Method Details

    • getClassLoader

      ClassLoader getClassLoader()
      Classloader able to load from downloaded dependencies.
    • setClassLoader

      void setClassLoader(ClassLoader classLoader)
      Sets the classloader to use that will be able to load from downloaded dependencies
    • addDownloadListener

      void addDownloadListener(DownloadListener downloadListener)
      Adds a listener to capture download activity
    • addArtifactDownloadListener

      void addArtifactDownloadListener(ArtifactDownloadListener downloadListener)
      Adds a listener to capture download activity
    • getRepos

      String getRepos()
    • setRepos

      void setRepos(String repos)
      Additional maven repositories for download on-demand (Use commas to separate multiple repositories).
    • setDownload

      void setDownload(boolean download)
      Whether downloading from remote Maven repositories is enabled
    • isDownload

      boolean isDownload()
      Whether downloading from remote Maven repositories is enabled
    • isFresh

      boolean isFresh()
    • setFresh

      void setFresh(boolean fresh)
      Make sure we use fresh (i.e. non-cached) resources.
    • getMavenSettings

      String getMavenSettings()
    • setMavenSettings

      void setMavenSettings(String mavenSettings)
      Configure location of Maven settings.xml file
    • getMavenSettingsSecurity

      String getMavenSettingsSecurity()
    • setMavenSettingsSecurity

      void setMavenSettingsSecurity(String mavenSettingsSecurity)
      Configure location of Maven settings-security.xml file
    • downloadDependency

      void downloadDependency(String groupId, String artifactId, String version)
      Downloads the dependency incl transitive dependencies
      Parameters:
      groupId - maven group id
      artifactId - maven artifact id
      version - maven version
    • downloadDependency

      void downloadDependency(String groupId, String artifactId, String version, String extraRepos)
      Downloads the dependency incl transitive dependencies
      Parameters:
      groupId - maven group id
      artifactId - maven artifact id
      version - maven version
      extraRepos - additional remote maven repositories to use when downloading
    • downloadDependency

      void downloadDependency(String groupId, String artifactId, String version, boolean transitively)
      Downloads the dependency
      Parameters:
      groupId - maven group id
      artifactId - maven artifact id
      version - maven version
      transitively - whether to include transitive dependencies
    • downloadHiddenDependency

      void downloadHiddenDependency(String groupId, String artifactId, String version)
      Downloads as hidden dependency that are not captured as a requirement
      Parameters:
      groupId - maven group id
      artifactId - maven artifact id
      version - maven version
    • downloadArtifact

      org.apache.camel.tooling.maven.MavenArtifact downloadArtifact(String groupId, String artifactId, String version)
      Downloads a single maven artifact (no transitive dependencies)
      Parameters:
      groupId - maven group id
      artifactId - maven artifact id
      version - maven version
      Returns:
      the artifact, or null if none found
    • resolveAvailableVersions

      List<String[]> resolveAvailableVersions(String groupId, String artifactId, String minimumVersion, String repo)
      Resolves the available versions for the given maven artifact
      Parameters:
      groupId - maven group id
      artifactId - maven artifact id
      minimumVersion - optional minimum version to avoid resolving too old releases
      repo - to use specific maven repository instead of maven central (used if repo is null)
      Returns:
      list of versions of the given artifact (0=camel-core version, 1=runtime version, such as spring-boot or quarkus)
    • alreadyOnClasspath

      boolean alreadyOnClasspath(String groupId, String artifactId, String version)
      Checks whether the dependency is already on the classpath
      Parameters:
      groupId - maven group id
      artifactId - maven artifact id
      version - maven version
      Returns:
      true if already on classpath, false if not.
    • onLoadingKamelet

      void onLoadingKamelet(String name)
      When a kamelet is being loaded
      Parameters:
      name - the kamelet name
    • onLoadingModeline

      void onLoadingModeline(String key, String value)
      When a modeline is being loaded
      Parameters:
      key - modeline key
      value - modeline value
    • getDownloadState

      DownloadRecord getDownloadState(String groupId, String artifactId, String version)
      Gets download record for a given artifact
      Returns:
      download record (if any) or null if artifact was not downloaded, but could have been resolved from local disk
    • downloadRecords

      Collection<DownloadRecord> downloadRecords()
      Gets the records for the downloaded artifacts
    • getRepositoryResolver

      org.apache.camel.tooling.maven.RepositoryResolver getRepositoryResolver()
      Gets the RepositoryResolver