Fix karaf features, and add testing for them. 05/10105/2
authorEd Warnicke <eaw@cisco.com>
Wed, 20 Aug 2014 16:09:15 +0000 (11:09 -0500)
committerEd Warnicke <eaw@cisco.com>
Wed, 20 Aug 2014 23:28:35 +0000 (18:28 -0500)
Change-Id: I272e0b92099d68e72f30138fe42935495ddf7d94
Signed-off-by: Ed Warnicke <eaw@cisco.com>
feature/pom.xml [deleted file]
feature/src/main/resources/features.xml [deleted file]
features/pom.xml [new file with mode: 0644]
features/src/main/resources/features.xml [new file with mode: 0644]
pom.xml

diff --git a/feature/pom.xml b/feature/pom.xml
deleted file mode 100644 (file)
index bfd110c..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.opendaylight.openflowjava</groupId>
-    <artifactId>openflow-protocol-parent</artifactId>
-    <version>0.5-SNAPSHOT</version>
-  </parent>
-  <artifactId>openflowjava-features</artifactId>
-  <name>Openflow Protocol Library - Karaf Features</name>
-
-  <packaging>pom</packaging>
-
-  <properties>
-    <features.file>features.xml</features.file>
-  </properties>
-
-  <dependencies></dependencies>
-
-  <build>
-    <resources>
-      <resource>
-        <filtering>true</filtering>
-        <directory>src/main/resources</directory>
-      </resource>
-    </resources>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-resources-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>filter</id>
-            <goals>
-              <goal>resources</goal>
-            </goals>
-            <phase>generate-resources</phase>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>attach-artifacts</id>
-            <goals>
-              <goal>attach-artifact</goal>
-            </goals>
-            <phase>package</phase>
-            <configuration>
-              <artifacts>
-                <artifact>
-                  <file>${project.build.directory}/classes/${features.file}</file>
-                  <type>xml</type>
-                  <classifier>features</classifier>
-                </artifact>
-              </artifacts>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-  <scm>
-    <connection>scm:git:ssh://git.opendaylight.org:29418/openflowjava.git</connection>
-    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/openflowjava.git</developerConnection>
-    <tag>HEAD</tag>
-    <url>https://wiki.opendaylight.org/view/Openflow_Protocol_Library:Main</url>
-  </scm>
-</project>
diff --git a/feature/src/main/resources/features.xml b/feature/src/main/resources/features.xml
deleted file mode 100644 (file)
index 1692a3d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<features name="config-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
-   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
-
-    <feature name='odl-openflowjava' version='${project.version}'>
-        <feature version='${yangtools.version}'>yangtools-concepts</feature>
-        <feature version='${yangtools.version}'>yangtools-binding</feature>
-        <feature version='${yangtools.version}'>yangtools-binding-generator</feature>
-        <feature version='${yangtools.version}'>yangtools-models</feature>
-        <feature version='${config.version}'>odl-config-subsystem</feature>
-        <bundle>mvn:io.netty/netty-buffer/${netty.version}</bundle>
-        <bundle>mvn:io.netty/netty-common/${netty.version}</bundle>
-        <bundle>mvn:io.netty/netty-transport/${netty.version}</bundle>
-        <bundle>mvn:io.netty/netty-codec/${netty.version}</bundle>
-        <bundle>mvn:io.netty/netty-handler/${netty.version}</bundle>
-        <bundle>mvn:org.opendaylight.openflowjava/openflow-protocol-api/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.openflowjava/openflow-protocol-spi/${project.version}</bundle>
-        <bundle>mvn:org.opendaylight.openflowjava/openflow-protocol-impl/${project.version}</bundle>
-    </feature>
-</features>
\ No newline at end of file
diff --git a/features/pom.xml b/features/pom.xml
new file mode 100644 (file)
index 0000000..1ec17d8
--- /dev/null
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.openflowjava</groupId>
+    <artifactId>openflow-protocol-parent</artifactId>
+    <version>0.5-SNAPSHOT</version>
+    <relativePath>../</relativePath>
+  </parent>
+  <artifactId>features-openflowjava</artifactId>
+
+  <packaging>jar</packaging>
+
+  <properties>
+    <features.file>features.xml</features.file>
+    <karaf.empty.distro.version>1.4.2-SNAPSHOT</karaf.empty.distro.version>
+    <yangtools.version>0.6.2-SNAPSHOT</yangtools.version>
+  </properties>
+
+  <dependencies>
+    <!-- feature dependencies -->
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>features-yangtools</artifactId>
+      <classifier>features</classifier>
+      <type>xml</type>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>features-config</artifactId>
+      <classifier>features</classifier>
+      <type>xml</type>
+    </dependency>
+
+    <!-- bundle dependencies -->
+    <dependency>
+      <groupId>org.opendaylight.openflowjava</groupId>
+      <artifactId>openflow-protocol-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.openflowjava</groupId>
+      <artifactId>openflow-protocol-spi</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.openflowjava</groupId>
+      <artifactId>openflow-protocol-impl</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.openflowjava</groupId>
+      <artifactId>util</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-codec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-handler</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-buffer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-transport</artifactId>
+    </dependency>
+    <!-- test the features.xml -->
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>features-test</artifactId>
+    </dependency>
+    <!-- dependency for opendaylight-karaf-empty for use by testing -->
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>opendaylight-karaf-empty</artifactId>
+      <version>${karaf.distro.empty.version}</version>
+      <type>zip</type>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <filtering>true</filtering>
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>filter</id>
+            <goals>
+              <goal>resources</goal>
+            </goals>
+            <phase>generate-resources</phase>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-artifacts</id>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <phase>package</phase>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>${project.build.directory}/classes/${features.file}</file>
+                  <type>xml</type>
+                  <classifier>features</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.16</version>
+        <configuration>
+          <systemPropertyVariables>
+            <karaf.distro.groupId>org.opendaylight.controller</karaf.distro.groupId>
+            <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
+            <karaf.distro.version>${karaf.empty.distro.version}</karaf.distro.version>
+          </systemPropertyVariables>
+          <dependenciesToScan>
+           <dependency>org.opendaylight.yangtools:features-test</dependency>
+          </dependenciesToScan>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+  </scm>
+</project>
diff --git a/features/src/main/resources/features.xml b/features/src/main/resources/features.xml
new file mode 100644 (file)
index 0000000..2419f1f
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<features name="odl-openflowjava-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+    <repository>mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
+    <repository>mvn:org.opendaylight.controller/features-config/${config.version}/xml/features</repository>
+    <feature name='odl-openflowjava-all' description="OpenDaylight :: Openflow Java :: All">
+        <feature version='${project.version}'>odl-openflowjava-protocol</feature>
+    </feature>
+    <feature name='odl-openflowjava-protocol' version='${project.version}' description="OpenDaylight :: Openflow Java :: Protocol">
+        <feature version='${yangtools.version}'>odl-yangtools-common</feature>
+        <feature version='${yangtools.version}'>odl-yangtools-binding</feature>
+        <feature version='${yangtools.version}'>odl-yangtools-binding-generator</feature>
+        <feature version='${yangtools.version}'>odl-yangtools-models</feature>
+        <feature version='${config.version}'>odl-config-api</feature>
+        <feature version='${yang.prototype.version}'>odl-mdsal-common</feature>
+        <bundle>mvn:io.netty/netty-buffer/${netty.version}</bundle>
+        <bundle>mvn:io.netty/netty-common/${netty.version}</bundle>
+        <bundle>mvn:io.netty/netty-transport/${netty.version}</bundle>
+        <bundle>mvn:io.netty/netty-codec/${netty.version}</bundle>
+        <bundle>mvn:io.netty/netty-handler/${netty.version}</bundle>
+        <bundle>mvn:org.opendaylight.openflowjava/openflow-protocol-api/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.openflowjava/openflow-protocol-spi/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.openflowjava/openflow-protocol-impl/${project.version}</bundle>
+        <bundle>mvn:org.opendaylight.openflowjava/util/${project.version}</bundle>
+    </feature>
+</features>
diff --git a/pom.xml b/pom.xml
index a808355eeaa93c027f7d271598c793520655a3d7..29c8df680268026ad19e0ae1415cfa8361d8601c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
         <module>util</module>
         <module>openflow-protocol-impl</module>
         <module>openflow-protocol-it</module>
-        <module>feature</module>
+        <module>features</module>
         <module>simple-client</module>
         <module>openflow-nx-resubmit-action</module>
         <module>openflow-extension-nicira</module>
@@ -36,6 +36,7 @@
         <url.version>1.5.0</url.version>
         <enunciate.version>1.26.2</enunciate.version>
         <jmxGeneratorPath>${project.build.directory}/yang-gen-config</jmxGeneratorPath>
+        <karaf.distro.empty.version>1.4.2-SNAPSHOT</karaf.distro.empty.version>
         <salGeneratorPath>${project.build.directory}/yang-gen-sal</salGeneratorPath>
         <sonar.branch>${user.name}-private-view</sonar.branch>
         <sonar.skippedModules>org.openflow.openflowj,net.sf.jung2</sonar.skippedModules>
 
     <dependencyManagement>
         <dependencies>
+            <!-- feature dependencies -->
+            <dependency>
+              <groupId>org.opendaylight.yangtools</groupId>
+              <artifactId>features-yangtools</artifactId>
+              <version>${yangtools.version}</version>
+              <classifier>features</classifier>
+              <type>xml</type>
+            </dependency>
+            <dependency>
+              <groupId>org.opendaylight.controller</groupId>
+              <artifactId>features-config</artifactId>
+              <version>${config.version}</version>
+              <classifier>features</classifier>
+              <type>xml</type>
+            </dependency>
             <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>slf4j-api</artifactId>
                 <artifactId>netty-handler</artifactId>
                 <version>${netty.version}</version>
             </dependency>
+            <dependency>
+                <groupId>io.netty</groupId>
+                <artifactId>netty-codec</artifactId>
+                <version>${netty.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.netty</groupId>
+                <artifactId>netty-common</artifactId>
+                <version>${netty.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.netty</groupId>
+                <artifactId>netty-transport</artifactId>
+                <version>${netty.version}</version>
+            </dependency>
             <dependency>
                 <groupId>com.google.guava</groupId>
                 <artifactId>guava</artifactId>
                 <version>1.9.5</version>
                 <scope>test</scope>
             </dependency>
+            <dependency>
+              <groupId>org.opendaylight.yangtools</groupId>
+              <artifactId>features-test</artifactId>
+              <version>${yangtools.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>