Package org.apache.camel.catalog.maven
Class MavenVersionManager
java.lang.Object
org.apache.camel.catalog.maven.MavenVersionManager
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.camel.catalog.VersionManager
public class MavenVersionManager
extends Object
implements org.apache.camel.catalog.VersionManager, Closeable
A
VersionManager that can load the resources using Maven to download needed artifacts from a local or remote
Maven repository.
This implementation uses Maven Resolver to download the Maven JARs.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMavenRepository(String name, String url) To add a 3rd party Maven repository.voidclose()getResourceAsStream(String name) booleanloadRuntimeProviderVersion(String groupId, String artifactId, String version) booleanloadVersion(String version) voidsetCacheDirectory(String directory) Configures the directory for the download cache.voidsetClassLoader(ClassLoader classLoader) voidsetHttpClientRequestTimeout(int timeout) Sets the read timeout in millis when downloading via http/https protocols.voidsetHttpClientTimeout(int timeout) Sets the connection timeout in millis when downloading via http/https protocols.voidsetLog(boolean log) Sets whether to log errors and warnings to System.out.
-
Constructor Details
-
MavenVersionManager
public MavenVersionManager()
-
-
Method Details
-
setClassLoader
- Specified by:
setClassLoaderin interfaceorg.apache.camel.catalog.VersionManager
-
getClassLoader
- Specified by:
getClassLoaderin interfaceorg.apache.camel.catalog.VersionManager
-
setCacheDirectory
Configures the directory for the download cache. The default folder is USER_HOME/.m2/repository- Parameters:
directory- the directory.
-
setLog
public void setLog(boolean log) Sets whether to log errors and warnings to System.out. By default nothing is logged. -
setHttpClientTimeout
public void setHttpClientTimeout(int timeout) Sets the connection timeout in millis when downloading via http/https protocols. The default value is 10000 -
setHttpClientRequestTimeout
public void setHttpClientRequestTimeout(int timeout) Sets the read timeout in millis when downloading via http/https protocols. The default value is 1800000 -
addMavenRepository
To add a 3rd party Maven repository.- Parameters:
name- the repository nameurl- the repository url
-
getLoadedVersion
- Specified by:
getLoadedVersionin interfaceorg.apache.camel.catalog.VersionManager
-
loadVersion
- Specified by:
loadVersionin interfaceorg.apache.camel.catalog.VersionManager
-
getRuntimeProviderLoadedVersion
- Specified by:
getRuntimeProviderLoadedVersionin interfaceorg.apache.camel.catalog.VersionManager
-
loadRuntimeProviderVersion
- Specified by:
loadRuntimeProviderVersionin interfaceorg.apache.camel.catalog.VersionManager
-
getResourceAsStream
- Specified by:
getResourceAsStreamin interfaceorg.apache.camel.catalog.VersionManager
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-