Handle odl-mdsal-common with Karaf 4.0.9 07/54607/1
authorStephen Kitt <skitt@redhat.com>
Mon, 10 Apr 2017 15:00:17 +0000 (17:00 +0200)
committerStephen Kitt <skitt@redhat.com>
Mon, 10 Apr 2017 15:00:17 +0000 (17:00 +0200)
Karaf 4.0.9 simplifies feature dependencies (so that dependencies
specified in feature.xml can be completed from the POM), but that
causes issues with odl-mdsal-common since features in Karaf are
identified by their name only:

* if both the controller odl-mdsal-common and the mdsal
  odl-mdsal-common are encountered in the dependency tree, whichever
  one came first (as dependencies are resolved) is the one that ends
  up being kept;
* in some circumstances, the mdsal repository replaces controller's
  even when the controller dependency is retained (this is a Karaf bug
  which I'll submit a patch for, but we can work around it).

Change-Id: I5400a829560ae96cb2f264e103020cccd1d225c3
Signed-off-by: Stephen Kitt <skitt@redhat.com>
features/mdsal/odl-mdsal-broker-local/pom.xml
features/mdsal/odl-mdsal-broker-local/src/main/feature/feature.xml

index 3ba139a..b947c7e 100644 (file)
     </dependencyManagement>
 
     <dependencies>
+        <dependency>
+            <!-- This needs to come first, otherwise mdsal's odl-mdsal-common is picked instead -->
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>odl-mdsal-common</artifactId>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>odl-yangtools-common</artifactId>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>odl-mdsal-common</artifactId>
-            <type>xml</type>
-            <classifier>features</classifier>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>odl-config-startup</artifactId>
index ff4c8d4..c808b48 100644 (file)
@@ -7,6 +7,8 @@
  and is available at http://www.eclipse.org/legal/epl-v10.html
  -->
 <features name="odl-mdsal-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
+    <!-- This needs to be added manually until we resolve the odl-mdsal-common situation -->
+    <repository>mvn:org.opendaylight.controller/odl-mdsal-common/${project.version}/xml/features</repository>
     <feature name="odl-mdsal-broker-local" version="${project.version}">
         <bundle start-level="70">mvn:org.opendaylight.controller/sal-schema-service/${project.version}</bundle>
         <bundle start-level="40">mvn:org.opendaylight.controller/blueprint/${blueprint.version}</bundle>

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.