Ensure Jersey is initialised before AAA-Shiro 71/70971/2
authorStephen Kitt <skitt@redhat.com>
Mon, 16 Apr 2018 09:16:32 +0000 (11:16 +0200)
committerStephen Kitt <skitt@redhat.com>
Mon, 16 Apr 2018 12:09:10 +0000 (14:09 +0200)
When we group the Jersey bundles with bundles using them, we run into
initialisation races where AAA-Shiro ends up trying to use Jersey
before the latter’s activators have run.

All credit to Robert Varga for figuring out that we need an ordering
constraint between Jersey as a whole and the rest of AAA-Shiro. The
new odl-aaa-jersey-1 feature will eventually be replaced by ODL
Parent’s odl-jersey-1 feature, once we’ve added jersey-client to
that.

Issue: RELENG-85
Change-Id: I3d87dc28c8067bbeb0ca32be96ccdb4f6d359573
Signed-off-by: Stephen Kitt <skitt@redhat.com>
features/odl-aaa-jersey-1/pom.xml [new file with mode: 0644]
features/odl-aaa-shiro/pom.xml
features/pom.xml

diff --git a/features/odl-aaa-jersey-1/pom.xml b/features/odl-aaa-jersey-1/pom.xml
new file mode 100644 (file)
index 0000000..4dd3e0c
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright © 2018 Red Hat, Inc. and others.
+
+ 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">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>single-feature-parent</artifactId>
+        <version>3.1.0</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.opendaylight.aaa</groupId>
+    <artifactId>odl-aaa-jersey-1</artifactId>
+    <version>0.8.0-SNAPSHOT</version>
+    <packaging>feature</packaging>
+
+    <!-- odl-aaa-jersey-1 feature which provides Jersey 1 -->
+    <name>ODL :: aaa :: ${project.artifactId}</name>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>aaa-parent</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.sun.jersey</groupId>
+            <artifactId>jersey-servlet</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.jersey</groupId>
+            <artifactId>jersey-server</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.jersey</groupId>
+            <artifactId>jersey-client</artifactId>
+        </dependency>
+    </dependencies>
+</project>
index 18d90c8df2bb85e88a6fbfa6efd07f2fae52eeb6..d79e09e6337701bf5c85452beaef46b4732ac821 100644 (file)
     </dependencyManagement>
 
     <dependencies>
+        <dependency>
+            <!-- We need to depend on a separate Jersey feature to ensure that
+                 it’s all initialised before we start using it; see also the
+                 prerequisite setup below -->
+            <groupId>org.opendaylight.aaa</groupId>
+            <artifactId>odl-aaa-jersey-1</artifactId>
+            <version>${project.version}</version>
+            <classifier>features</classifier>
+            <type>xml</type>
+        </dependency>
 
         <!-- OSGI -->
         <dependency>
             <classifier>config</classifier>
         </dependency>
     </dependencies>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.karaf.tooling</groupId>
+                    <artifactId>karaf-maven-plugin</artifactId>
+                    <configuration>
+                        <prerequisiteFeatures>
+                            <prerequisiteFeature>odl-aaa-jersey-1</prerequisiteFeature>
+                        </prerequisiteFeatures>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
 </project>
index d73a29da388a4f39db22061204d4cb83187daf26..2727c880990843018dfcd3a31530b29560462f7e 100644 (file)
@@ -27,6 +27,7 @@
         <module>odl-aaa-cert</module>
         <module>odl-aaa-cli</module>
         <module>odl-aaa-encryption-service</module>
+        <module>odl-aaa-jersey-1</module>
         <module>odl-aaa-shiro</module>
         <module>odl-aaa-shiro-act</module>
         <module>odl-aaa-web</module>