use bundle metadata from BOM file
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/99dfb6f9 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/99dfb6f9 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/99dfb6f9 Branch: refs/heads/master Commit: 99dfb6f98837dd04c7a18a5767c8537af9e3b949 Parents: c9fd077 Author: Alex Heneveld <[email protected]> Authored: Mon Apr 24 15:19:53 2017 +0100 Committer: Alex Heneveld <[email protected]> Committed: Mon Apr 24 15:21:45 2017 +0100 ---------------------------------------------------------------------- .../org/apache/brooklyn/rest/resources/CatalogResource.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/99dfb6f9/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java ---------------------------------------------------------------------- diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java index 24bd47e..f1d8638 100644 --- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java +++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java @@ -209,7 +209,8 @@ public class CatalogResource extends AbstractBrooklynRestResource implements Cat throw new IllegalArgumentException("JAR MANIFEST symbolic-name '"+bundleNameInMF+"' does not match '"+vn.getSymbolicName()+"' defined in BOM"); } } else { - mf.getMainAttributes().putValue(Constants.BUNDLE_SYMBOLICNAME, vn.getSymbolicName()); + bundleNameInMF = vn.getSymbolicName(); + mf.getMainAttributes().putValue(Constants.BUNDLE_SYMBOLICNAME, bundleNameInMF); } String bundleVersionInMF = mf.getMainAttributes().getValue(Constants.BUNDLE_VERSION); @@ -218,7 +219,8 @@ public class CatalogResource extends AbstractBrooklynRestResource implements Cat throw new IllegalArgumentException("JAR MANIFEST version '"+bundleVersionInMF+"' does not match '"+vn.getVersion()+"' defined in BOM"); } } else { - mf.getMainAttributes().putValue(Constants.BUNDLE_VERSION, vn.getVersion().toString()); + bundleVersionInMF = vn.getVersion().toString(); + mf.getMainAttributes().putValue(Constants.BUNDLE_VERSION, bundleVersionInMF); } if (mf.getMainAttributes().getValue(Attributes.Name.MANIFEST_VERSION)==null) { mf.getMainAttributes().putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
