Reuse extracted manifest
Obtaining the manifest can cost us some IO. Treat it as an invariant
when determining whether a file is a bundle.
@@ -483,8 +483,6 @@ public class GenerateDescriptorMojo extends MojoSupport {
if (!this.dependencyHelper.isArtifactAFeature(artifact)) {
String bundleName = this.dependencyHelper.artifactToMvn(artifact, getVersionOrRange(entry.getParent(), artifact));
- File bundleFile = this.dependencyHelper.resolve(artifact, getLog());
- Manifest manifest = getManifest(bundleFile);
for (ConfigFile cf : feature.getConfigfile()) {
if (bundleName.equals(cf.getLocation().replace('\n', ' ').trim())) {
@@ -493,7 +491,9 @@ public class GenerateDescriptorMojo extends MojoSupport {
}
}
- if (manifest == null || !ManifestUtils.isBundle(getManifest(bundleFile))) {
+ File bundleFile = this.dependencyHelper.resolve(artifact, getLog());
+ Manifest manifest = getManifest(bundleFile);
+ if (manifest == null || !ManifestUtils.isBundle(manifest)) {
bundleName = "wrap:" + bundleName;
needWrap = true;
}
