public class MavenClassLoaderModelLoader extends Object implements ClassLoaderModelLoader
BundleDescriptor of a given plugin's location and also creating a ClassLoaderModel
TODO(fernandezlautaro): MULE-11094 this class is the default implementation for discovering dependencies and URLs, which happens to be Maven based. There could be other ways to look for dependencies and URLs (probably for testing purposes where the plugins are done by hand and without maven) which will imply implementing the jira pointed out in this comment.| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
MavenClassLoaderModelLoader() |
| Modifier and Type | Method and Description |
|---|---|
String |
getId() |
ClassLoaderModel |
load(File artifactFolder,
Map<String,Object> attributes)
Given a plugin's location, it will resolve its dependencies on a Maven based mechanism.
|
public String getId()
getId in interface DescriptorLoader<ClassLoaderModel>public ClassLoaderModel load(File artifactFolder, Map<String,Object> attributes) throws InvalidDescriptorLoaderException
ArtifactPluginDescriptor.REPOSITORY
folder to look for the artifacts in it (which includes both JAR files as well as POM ones).
It takes care of the transitive compile and runtime dependencies, from which will take the URLs to add them to the resulting
ClassLoaderModel, and it will also consume all Mule plugin dependencies so that further validations can check whether
or not all plugins are loaded in memory before running an application.
Finally, it will also tell the resulting ClassLoaderModel which packages and/or resources has to export, consuming the
attributes from the MuleArtifactLoaderDescriptor.getAttributes() map.load in interface DescriptorLoader<ClassLoaderModel>artifactFolder - File where the current plugin to work with.attributes - a set of attributes to work with, where the current implementation of this class will look for MavenClassLoaderConstants.EXPORTED_PACKAGES
and MavenClassLoaderConstants.EXPORTED_RESOURCESClassLoaderModel loaded with all its dependencies and URLs.InvalidDescriptorLoaderExceptionBundlePluginDependenciesResolver.getArtifactsWithDependencies(List, Set)Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.