@Override
public Map<Long, Set<ExportPackage>> select(OSGiBuildContext context) {
Map<Long, Set<ExportPackage>> bundleIdExportPackages = new HashMap<Long, Set<ExportPackage>>();
Map<String, Version> packageNameVersionMap = new HashMap<String, Version>();
DependencyManager dependencyManager = context.getDependencyManager();
for (Dependency dependency : context.getEnvironment().getDependencies()) {
Artifact resolvedArtifact = context.resolveArtifact(dependency.getArtifact());
if(resolvedArtifact == null) {
logger.warn("Dependency " + dependency.getArtifact() + " could not be resolved, its export packages are ignored");
continue;
}
Bundle dependentBundle = dependencyManager.getBundle(resolvedArtifact);
if (dependentBundle == null) {
logger.warn("Fail to resolve the bundle corresponding to the artifact " + dependency.getArtifact() + ", its export packages are ignored");
continue;
}
Set<ExportPackage> exportPackages = context.getEffectExportPackages(dependentBundle.getBundleId());