use of org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor in project mule by mulesoft.
the class BundlePluginDependenciesResolver method findDependencyPackageClosure.
private Set<String> findDependencyPackageClosure(Set<BundleDependency> pluginDependencies, List<ArtifactPluginDescriptor> resolvedPlugins) {
Set<String> exportedPackages = new HashSet<>();
for (BundleDependency pluginDependency : pluginDependencies) {
final Optional<String> classifier = pluginDependency.getDescriptor().getClassifier();
if (classifier.isPresent() && MULE_PLUGIN_CLASSIFIER.equals(classifier.get())) {
ArtifactPluginDescriptor dependencyDescriptor = findArtifactPluginDescriptor(pluginDependency, resolvedPlugins);
exportedPackages.addAll(dependencyDescriptor.getClassLoaderModel().getExportedPackages());
exportedPackages.addAll(findDependencyPackageClosure(dependencyDescriptor.getClassLoaderModel().getDependencies(), resolvedPlugins));
}
}
return exportedPackages;
}
use of org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor in project mule by mulesoft.
the class BundlePluginDependenciesResolver method createResolutionErrorMessage.
protected static String createResolutionErrorMessage(List<ArtifactPluginDescriptor> unresolvedPlugins, List<ArtifactPluginDescriptor> resolvedPlugins) {
StringBuilder builder = new StringBuilder("Unable to resolve plugin dependencies:");
for (ArtifactPluginDescriptor unresolvedPlugin : unresolvedPlugins) {
builder.append("\nPlugin: ").append(unresolvedPlugin.getName()).append(" missing dependencies:");
List<BundleDependency> missingDependencies = new ArrayList<>();
for (BundleDependency dependency : unresolvedPlugin.getClassLoaderModel().getDependencies()) {
Optional<String> classifierOptional = dependency.getDescriptor().getClassifier();
if (classifierOptional.isPresent() && MULE_PLUGIN_CLASSIFIER.equals(classifierOptional.get())) {
final ArtifactPluginDescriptor dependencyDescriptor = findArtifactPluginDescriptor(dependency, resolvedPlugins);
if (dependencyDescriptor == null) {
missingDependencies.add(dependency);
}
}
}
builder.append(missingDependencies);
}
return builder.toString();
}
Aggregations