in src/main/java/org/apache/sling/feature/scanner/impl/BundleDescriptorImpl.java [192:229]
private void analyze() throws IOException {
final String name = this.manifest.getMainAttributes().getValue(Constants.BUNDLE_SYMBOLICNAME);
if (name != null) {
final String version = this.manifest.getMainAttributes().getValue(Constants.BUNDLE_VERSION);
if (version == null) {
throw new IOException("Unable to get bundle version from artifact "
+ getArtifact().getId().toMvnId());
}
this.symbolicName = name;
this.bundleVersion = version;
final String newBundleName = this.getArtifact().getMetadata().get("bundle:rename-bsn");
if (newBundleName != null) {
this.symbolicName = newBundleName;
}
this.getExportedPackages().addAll(extractExportedPackages(this.manifest));
this.getImportedPackages().addAll(extractImportedPackages(this.manifest));
this.getDynamicImportedPackages().addAll(extractDynamicImportedPackages(this.manifest));
try {
ResourceImpl resource = ResourceBuilder.build(
this.artifact.getId().toMvnUrl(),
this.manifest.getMainAttributes().entrySet().stream()
.collect(
Collectors.toMap(entry -> entry.getKey().toString(), entry -> entry.getValue()
.toString())));
this.getCapabilities().addAll(resource.getCapabilities(null));
this.getRequirements()
.addAll(resource.getRequirements(null).stream()
.map(entry -> new MatchingRequirementImpl(entry))
.collect(Collectors.toList()));
} catch (Exception ex) {
throw new IOException(ex);
}
} else {
throw new IOException("Unable to get bundle symbolic name from artifact "
+ getArtifact().getId().toMvnId());
}
}