Package org.apache.camel.main.download
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 Summary
Modifier and TypeMethodDescriptionvoidaddArtifactDownloadListener(ArtifactDownloadListener downloadListener) Adds a listener to capture download activityvoidaddDownloadListener(DownloadListener downloadListener) Adds a listener to capture download activitybooleanalreadyOnClasspath(String groupId, String artifactId, String version) Checks whether the dependency is already on the classpathorg.apache.camel.tooling.maven.MavenArtifactdownloadArtifact(String groupId, String artifactId, String version) Downloads a single maven artifact (no transitive dependencies)voiddownloadDependency(String groupId, String artifactId, String version) Downloads the dependency incl transitive dependenciesvoiddownloadDependency(String groupId, String artifactId, String version, boolean transitively) Downloads the dependencyvoiddownloadDependency(String groupId, String artifactId, String version, String extraRepos) Downloads the dependency incl transitive dependenciesvoiddownloadHiddenDependency(String groupId, String artifactId, String version) Downloads as hidden dependency that are not captured as a requirementGets the records for the downloaded artifactsClassloader able to load from downloaded dependencies.getDownloadState(String groupId, String artifactId, String version) Gets download record for a given artifactgetRepos()org.apache.camel.tooling.maven.RepositoryResolverGets theRepositoryResolverbooleanWhether downloading from remote Maven repositories is enabledbooleanisFresh()voidonLoadingKamelet(String name) When a kamelet is being loadedvoidonLoadingModeline(String key, String value) When a modeline is being loadedresolveAvailableVersions(String groupId, String artifactId, String minimumVersion, String repo) Resolves the available versions for the given maven artifactvoidsetClassLoader(ClassLoader classLoader) Sets the classloader to use that will be able to load from downloaded dependenciesvoidsetDownload(boolean download) Whether downloading from remote Maven repositories is enabledvoidsetFresh(boolean fresh) Make sure we use fresh (i.e.voidsetMavenSettings(String mavenSettings) Configure location of Maven settings.xml filevoidsetMavenSettingsSecurity(String mavenSettingsSecurity) Configure location of Maven settings-security.xml filevoidAdditional maven repositories for download on-demand (Use commas to separate multiple repositories).Methods inherited from interface org.apache.camel.CamelContextAware
setCamelContextMethods inherited from interface org.apache.camel.spi.HasCamelContext
getCamelContextMethods inherited from interface org.apache.camel.Service
build, close, init, start, stop
-
Method Details
-
getClassLoader
ClassLoader getClassLoader()Classloader able to load from downloaded dependencies. -
setClassLoader
Sets the classloader to use that will be able to load from downloaded dependencies -
addDownloadListener
Adds a listener to capture download activity -
addArtifactDownloadListener
Adds a listener to capture download activity -
getRepos
String getRepos() -
setRepos
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
Configure location of Maven settings.xml file -
getMavenSettingsSecurity
String getMavenSettingsSecurity() -
setMavenSettingsSecurity
Configure location of Maven settings-security.xml file -
downloadDependency
Downloads the dependency incl transitive dependencies- Parameters:
groupId- maven group idartifactId- maven artifact idversion- maven version
-
downloadDependency
Downloads the dependency incl transitive dependencies- Parameters:
groupId- maven group idartifactId- maven artifact idversion- maven versionextraRepos- additional remote maven repositories to use when downloading
-
downloadDependency
Downloads the dependency- Parameters:
groupId- maven group idartifactId- maven artifact idversion- maven versiontransitively- whether to include transitive dependencies
-
downloadHiddenDependency
Downloads as hidden dependency that are not captured as a requirement- Parameters:
groupId- maven group idartifactId- maven artifact idversion- 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 idartifactId- maven artifact idversion- 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 idartifactId- maven artifact idminimumVersion- optional minimum version to avoid resolving too old releasesrepo- to use specific maven repository instead of maven central (used if repo isnull)- Returns:
- list of versions of the given artifact (0=camel-core version, 1=runtime version, such as spring-boot or quarkus)
-
alreadyOnClasspath
Checks whether the dependency is already on the classpath- Parameters:
groupId- maven group idartifactId- maven artifact idversion- maven version- Returns:
- true if already on classpath, false if not.
-
onLoadingKamelet
When a kamelet is being loaded- Parameters:
name- the kamelet name
-
onLoadingModeline
When a modeline is being loaded- Parameters:
key- modeline keyvalue- modeline value
-
getDownloadState
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 theRepositoryResolver
-