BUG-8923: create karaf-util 93/61293/6
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 7 Aug 2017 15:32:48 +0000 (17:32 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Aug 2017 08:38:08 +0000 (10:38 +0200)
We need to use opendaylight-karaf-empty for SFT, but doing so
directly leads to a circular dependency, as karaf-plugin needs
sft (which needs karaf-empty, which needs karaf-plugin).

Resolve the dependency cycle by breaking out the single class
karaf-plugin requires into a separate artifact.

Change-Id: Id0649dd8203087ed82c1b936428cb6d9295f2957
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5d3c00c2b98de5ebb4a7eda6e5cc0734c86b74f8)

bundles-test-lib/pom.xml
features-test/pom.xml
features-test/src/main/java/org/opendaylight/odlparent/featuretest/PerRepoTestRunner.java
karaf-plugin/pom.xml
karaf-plugin/src/main/java/org/opendaylight/odlparent/PopulateLocalRepoMojo.java
karaf-util/pom.xml [new file with mode: 0644]
karaf-util/src/main/java/org/opendaylight/odlparent/karafutil/CustomBundleUrlStreamHandlerFactory.java [moved from features-test/src/main/java/org/opendaylight/odlparent/featuretest/CustomBundleUrlStreamHandlerFactory.java with 97% similarity]
pom.xml

index ddfcc1edf397e9fa1513dd418a647b5b1ff1470e..6a71e350decc5ae61439993bc86568df0b33343f 100644 (file)
         </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.odlparent</groupId>
+      <artifactId>karaf-util</artifactId>
+      <version>${project.version}</version>
+    </dependency>
     <!-- BEWARE of adding additional dependencies here...
          It will cause weird issues e.g. in integration/distribution/features/repos/distribution -->
     <dependency>
index 1c0a4d682c9c7755ce04387c69c070c2a8f45cb0..c825d9ee90eaa8ecc13d2471bc09abb29b89e4a4 100644 (file)
             <artifactId>pax-url-aether</artifactId>
             <scope>compile</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.maven.wagon</groupId>
-            <artifactId>wagon-http</artifactId>
-            <version>2.10</version>
-            <scope>compile</scope>
-        </dependency>
         <dependency>
             <groupId>org.apache.karaf.features</groupId>
             <artifactId>standard</artifactId>
index 7c50546ff0bcfd19e46f3de7aa318413f92d4645..7ce2bd01edea8c04c23c4b928e9e972cb433d96a 100644 (file)
@@ -21,6 +21,7 @@ import org.junit.runner.Description;
 import org.junit.runner.notification.RunNotifier;
 import org.junit.runners.ParentRunner;
 import org.junit.runners.model.InitializationError;
+import org.opendaylight.odlparent.karafutil.CustomBundleUrlStreamHandlerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 3d1c27b6d75cb1ea3d817e8c5f5760545f61fddf..586c1f499a0dc2ed876152c3ea0fa7c61182dc93 100644 (file)
@@ -57,7 +57,7 @@
     </dependency>
     <dependency>
       <groupId>org.opendaylight.odlparent</groupId>
-      <artifactId>features-test</artifactId>
+      <artifactId>karaf-util</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
index fe7235e00d52c999b46827120b89e2a06c897fec..f6b9c8b7222b12d634068d1d1586f97b280af793 100644 (file)
@@ -38,7 +38,7 @@ import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.artifact.Artifact;
 import org.eclipse.aether.repository.RemoteRepository;
 import org.eclipse.aether.resolution.ArtifactResolutionException;
-import org.opendaylight.odlparent.featuretest.CustomBundleUrlStreamHandlerFactory;
+import org.opendaylight.odlparent.karafutil.CustomBundleUrlStreamHandlerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/karaf-util/pom.xml b/karaf-util/pom.xml
new file mode 100644 (file)
index 0000000..82bf29a
--- /dev/null
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright © 2014, 2017 Cisco Systems, Inc. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<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">
+
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>bundle-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+        <relativePath>../bundle-parent</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>karaf-util</artifactId>
+    <packaging>bundle</packaging>
+    <name>ODL :: odlparent :: ${project.artifactId}</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.karaf.deployer</groupId>
+            <artifactId>org.apache.karaf.deployer.blueprint</artifactId>
+            <version>${karaf.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.karaf.deployer</groupId>
+            <artifactId>org.apache.karaf.deployer.features</artifactId>
+            <version>${karaf.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven.wagon</groupId>
+            <artifactId>wagon-http</artifactId>
+            <version>2.10</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-wrap</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>check-license</id>
+                        <configuration>
+                            <excludes>
+                                <!-- Skip Apache Licensed files -->
+                                org/opendaylight/odlparent/karafutil/CustomBundleUrlStreamHandlerFactory.java
+                            </excludes>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+  <!--
+    Maven Site Configuration
+
+    The following configuration is necessary for maven-site-plugin to
+    correctly identify the correct deployment path for OpenDaylight Maven
+    sites.
+  -->
+  <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+  <distributionManagement>
+    <site>
+      <id>opendaylight-site</id>
+      <url>${nexus.site.url}/${project.artifactId}/</url>
+    </site>
+  </distributionManagement>
+</project>
diff --git a/pom.xml b/pom.xml
index 69cc865845499b1a713550058ec9134c4ee182a1..d2ad62aae0d8f392d9e87c6c09af9522a7091dbe 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -39,6 +39,7 @@
         <!-- Karaf integration -->
         <module>karaf</module>
         <module>karaf-plugin</module>
+        <module>karaf-util</module>
 
         <!-- Parent POMs -->
         <module>aggregator-parent</module>