Package org.apache.camel.tooling.maven
Interface MavenDownloader
- All Superinterfaces:
AutoCloseable,org.apache.camel.Service
- All Known Implementing Classes:
MavenDownloaderImpl
public interface MavenDownloader
extends org.apache.camel.Service
Pragmatic Maven download/resolution API that should replace usage of Ivy/Grape and Shrinkwrap across Camel.
-
Method Summary
Modifier and TypeMethodDescriptionExisting, configuredMavenDownloadercan be used as a template to create customized version which shares most of the configuration except underlyingorg.eclipse.aether.RepositorySystemSession, which can't be shared.Gets the repository resolver.booleanSets whether using SNAPSHOT versions of Apache Camel is enabled.booleanSets whether maven central repository should be included and as first in the list of repositories.resolveArtifacts(String rootGav, List<String> dependencyGAVs, Set<String> extraRepositories, boolean transitively, boolean useApacheSnapshots) Main resolution method.resolveArtifacts(List<String> dependencyGAVs, Set<String> extraRepositories, boolean transitively, boolean useApacheSnapshots) resolveAvailableVersions(String groupId, String artifactId, String repository) Resolves available versions for groupId + artifactId from single remote repository.voidsetFresh(boolean fresh) Set a flag determining Maven update behavior.voidsetMavenApacheSnapshotEnabled(boolean mavenApacheSnapshotEnabled) Sets whether using SNAPSHOT versions of Apache Camel is enabled.voidsetMavenCentralEnabled(boolean mavenCentralEnabled) Sets whether maven central repository should be included and as first in the list of repositories.voidsetMavenSettingsLocation(String mavenSettings) Configure a location ofsettings.xml(when not set, defaults to~/.m2/settings.xmlunless it's explicitly set to"false".voidsetMavenSettingsSecurityLocation(String mavenSettingsSecurity) Configure a location ofsettings-security.xml(when not set, defaults to~/.m2/settings-security.xmlunlesssetMavenSettingsLocation(String)is set explicitly set to"false".voidsetOffline(boolean offline) Sets maven downloader in offline modevoidTo use a listener when downloading from remote repositories.voidConfigure comma-separated list of repositories to use (in addition to the ones discovered from Maven settings).voidsetRepositoryResolver(RepositoryResolver repositoryResolver) Sets a custom repository resolver.Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
-
Method Details
-
resolveArtifacts
List<MavenArtifact> resolveArtifacts(String rootGav, 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 ofgroupId:artifactId[:packaging[:classifier]]:version) is used to download artifacts from configured Maven repositories.- Parameters:
rootGav- root Maven artifactdependencyGAVs- a list of Maven coordinatesextraRepositories- nullable list of additional repositories to use (except the discovered ones)transitively- whether to download/resolve dependencies transitivelyuseApacheSnapshots- whether to include Apache Snapshots repository in the list of used repositories- Throws:
MavenResolutionException
-
resolveArtifacts
List<MavenArtifact> resolveArtifacts(List<String> dependencyGAVs, Set<String> extraRepositories, boolean transitively, boolean useApacheSnapshots) throws MavenResolutionException - 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- groupIdartifactId- artifactIdrepository- external repository to use (defaults to Maven Central ifnull)- Throws:
MavenResolutionException
-
customize
Existing, configuredMavenDownloadercan be used as a template to create customized version which shares most of the configuration except underlyingorg.eclipse.aether.RepositorySystemSession, which can't be shared. -
setRemoteArtifactDownloadListener
To use a listener when downloading from remote repositories. -
setFresh
void setFresh(boolean fresh) Set a flag determining Maven update behavior. See the description of-U,--update-snapshotsMaven option. When set totrue, Maven metadata (to determine newest SNAPSHOT or RELEASE or LATEST version) is always fetched. -
setOffline
void setOffline(boolean offline) Sets maven downloader in offline mode -
setRepos
Configure comma-separated list of repositories to use (in addition to the ones discovered from Maven settings). -
setMavenSettingsSecurityLocation
Configure a location ofsettings-security.xml(when not set, defaults to~/.m2/settings-security.xmlunlesssetMavenSettingsLocation(String)is set explicitly set to"false". -
setMavenSettingsLocation
Configure a location ofsettings.xml(when not set, defaults to~/.m2/settings.xmlunless it's explicitly set to"false". -
getRepositoryResolver
RepositoryResolver getRepositoryResolver()Gets the repository resolver. -
setRepositoryResolver
Sets a custom repository resolver. -
setMavenCentralEnabled
void setMavenCentralEnabled(boolean mavenCentralEnabled) Sets whether maven central repository should be included and as first in the list of repositories. This can be used to turn of maven central for users that may use their own maven proxy. -
isMavenCentralEnabled
boolean isMavenCentralEnabled()Sets whether maven central repository should be included and as first in the list of repositories. This can be used to turn of maven central for users that may use their own maven proxy. -
setMavenApacheSnapshotEnabled
void setMavenApacheSnapshotEnabled(boolean mavenApacheSnapshotEnabled) Sets whether using SNAPSHOT versions of Apache Camel is enabled. If enabled then SNAPSHOT can be downloaded from the ASF SNAPSHOT maven repository. -
isMavenApacheSnapshotEnabled
boolean isMavenApacheSnapshotEnabled()Sets whether using SNAPSHOT versions of Apache Camel is enabled. If enabled then SNAPSHOT can be downloaded from the ASF SNAPSHOT maven repository.
-