karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [3/4] karaf git commit: Reuse extracted manifest
Date Fri, 29 Sep 2017 07:36:07 GMT
Reuse extracted manifest

Obtaining the manifest can cost us some IO. Treat it as an invariant
when determining whether a file is a bundle.

Signed-off-by: Robert Varga <nite@hq.sk>
(cherry picked from commit edcda0b0ea4a50ae8e8019af1eaff161507e3ee4)


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/7e860d33
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/7e860d33
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/7e860d33

Branch: refs/heads/karaf-4.0.x
Commit: 7e860d3392c947d662b1765a9206108a0222c7e0
Parents: 8d55bc7
Author: Robert Varga <nite@hq.sk>
Authored: Sun Aug 13 20:26:17 2017 +0200
Committer: Robert Varga <nite@hq.sk>
Committed: Wed Sep 27 13:33:38 2017 +0200

----------------------------------------------------------------------
 .../apache/karaf/tooling/features/GenerateDescriptorMojo.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/7e860d33/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
----------------------------------------------------------------------
diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
index 2d367dc..3d7c0ad 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
@@ -467,8 +467,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()))
{
@@ -477,7 +475,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;
                     }


Mime
View raw message