Package org.apache.camel.catalog.maven
Class DefaultMavenArtifactProvider
java.lang.Object
org.apache.camel.catalog.maven.DefaultMavenArtifactProvider
- All Implemented Interfaces:
MavenArtifactProvider
Default
MavenArtifactProvider which uses Groovy Grape to download the artifact.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddArtifactToCatalog(org.apache.camel.catalog.CamelCatalog camelCatalog, String groupId, String artifactId, String version) Downloads the artifact using the Maven coordinates and scans the JAR for Camel components which will be added to the CamelCatalog.voidaddMavenRepository(String name, String url) To add a 3rd party Maven repository.protected voidscanCamelComponents(org.apache.camel.catalog.CamelCatalog camelCatalog, ClassLoader classLoader, Set<String> names) voidsetCacheDirectory(String directory) Configures the directory for the download cache.voidsetLog(boolean log) Sets whether to log errors and warnings to System.out.
-
Constructor Details
-
DefaultMavenArtifactProvider
public DefaultMavenArtifactProvider()
-
-
Method Details
-
setLog
public void setLog(boolean log) Sets whether to log errors and warnings to System.out. By default nothing is logged. -
setCacheDirectory
Description copied from interface:MavenArtifactProviderConfigures the directory for the download cache. The default folder is USER_HOME/.groovy/grape- Specified by:
setCacheDirectoryin interfaceMavenArtifactProvider- Parameters:
directory- the directory.
-
addMavenRepository
Description copied from interface:MavenArtifactProviderTo add a 3rd party Maven repository.- Specified by:
addMavenRepositoryin interfaceMavenArtifactProvider- Parameters:
name- the repository nameurl- the repository url
-
addArtifactToCatalog
public Set<String> addArtifactToCatalog(org.apache.camel.catalog.CamelCatalog camelCatalog, String groupId, String artifactId, String version) Description copied from interface:MavenArtifactProviderDownloads the artifact using the Maven coordinates and scans the JAR for Camel components which will be added to the CamelCatalog.- Specified by:
addArtifactToCatalogin interfaceMavenArtifactProvider- Parameters:
camelCatalog- The Camel CataloggroupId- Maven group idartifactId- Maven artifact idversion- Maven version- Returns:
- the names of the components that was added, or an empty set if none found or they already exists in the catalog
-
scanCamelComponents
protected void scanCamelComponents(org.apache.camel.catalog.CamelCatalog camelCatalog, ClassLoader classLoader, Set<String> names)
-