use of org.mule.runtime.module.deployment.impl.internal.application.DeployableMavenClassLoaderModelLoader in project mule by mulesoft.
the class MavenClassLoaderModelLoader method createClassLoaderModelLoaders.
private void createClassLoaderModelLoaders() {
MavenClient mavenClient = mavenClientProvider.createMavenClient(mavenRuntimeConfig);
deployableMavenClassLoaderModelLoader = new DeployableMavenClassLoaderModelLoader(mavenClient, mavenClientProvider.getLocalRepositorySuppliers());
pluginMavenClassLoaderModelLoader = new PluginMavenClassLoaderModelLoader(mavenClient, mavenClientProvider.getLocalRepositorySuppliers());
libFolderClassLoaderModelLoader = new LibFolderClassLoaderModelLoader();
}
use of org.mule.runtime.module.deployment.impl.internal.application.DeployableMavenClassLoaderModelLoader in project mule by mulesoft.
the class PolicyTemplateDescriptorFactoryTestCase method setUp.
@Before
public void setUp() throws Exception {
when(descriptorLoaderRepository.get(FILE_SYSTEM_POLICY_MODEL_LOADER_ID, POLICY, ClassLoaderModelLoader.class)).thenReturn(new FileSystemPolicyClassLoaderModelLoader());
when(descriptorLoaderRepository.get(INVALID_LOADER_ID, POLICY, ClassLoaderModelLoader.class)).thenThrow(new LoaderNotFoundException(INVALID_LOADER_ID));
MavenClientProvider mavenClientProvider = MavenClientProvider.discoverProvider(currentThread().getContextClassLoader());
when(descriptorLoaderRepository.get(MULE_LOADER_ID, POLICY, ClassLoaderModelLoader.class)).thenReturn(new DeployableMavenClassLoaderModelLoader(mavenClientProvider.createMavenClient(newMavenConfigurationBuilder().localMavenRepositoryLocation(mavenClientProvider.getLocalRepositorySuppliers().environmentMavenRepositorySupplier().get()).build()), mavenClientProvider.getLocalRepositorySuppliers()));
when(descriptorLoaderRepository.get(PROPERTIES_BUNDLE_DESCRIPTOR_LOADER_ID, POLICY, BundleDescriptorLoader.class)).thenReturn(new PropertiesBundleDescriptorLoader());
when(descriptorLoaderRepository.get(INVALID_LOADER_ID, POLICY, BundleDescriptorLoader.class)).thenThrow(new LoaderNotFoundException(INVALID_LOADER_ID));
}
use of org.mule.runtime.module.deployment.impl.internal.application.DeployableMavenClassLoaderModelLoader in project mule by mulesoft.
the class DefaultConnectivityTestingServiceBuilder method build.
/**
* {@inheritDoc}
*/
@Override
public ConnectivityTestingService build() {
checkState(artifactDeclaration != null, "artifact configuration cannot be null");
return new TemporaryArtifactConnectivityTestingService(() -> {
String applicationName = UUID.getUUID() + "-connectivity-testing-temp-app";
File applicationFolder = new File(getExecutionFolder(), applicationName);
ApplicationDescriptor applicationDescriptor = new ApplicationDescriptor(applicationName);
applicationDescriptor.setArtifactDeclaration(artifactDeclaration);
applicationDescriptor.setConfigResources(emptySet());
applicationDescriptor.setArtifactLocation(applicationFolder);
createDeployablePomFile(applicationFolder, model);
updateArtifactPom(applicationFolder, model);
MavenClientProvider mavenClientProvider = MavenClientProvider.discoverProvider(DefaultConnectivityTestingServiceBuilder.class.getClassLoader());
applicationDescriptor.setClassLoaderModel(new DeployableMavenClassLoaderModelLoader(mavenClientProvider.createMavenClient(GlobalConfigLoader.getMavenConfig()), mavenClientProvider.getLocalRepositorySuppliers()).load(applicationFolder, emptyMap(), ArtifactType.APP));
return defaultApplicationFactory.createArtifact(applicationDescriptor);
});
}
Aggregations