Add common Jersey version 44/97844/2
authorliamfallon <liam.fallon@est.tech>
Fri, 1 Nov 2019 11:21:54 +0000 (11:21 +0000)
committerliamfallon <liam.fallon@est.tech>
Fri, 1 Nov 2019 11:43:12 +0000 (11:43 +0000)
Add a common version of Jersey for all Policy Framework components.

Issue-ID: POLICY-2209
Change-Id: I8554a97e9f13887418118966bfe1043b65d9a179
Signed-off-by: liamfallon <liam.fallon@est.tech>
gson/pom.xml
policy-endpoints/pom.xml
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyJerseyServer.java
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/MyJacksonProvider.java
pom.xml

index 9dfb524..02624f3 100644 (file)
@@ -3,6 +3,7 @@
   ONAP Policy Engine - Common Modules
   ================================================================================
   Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+  Modifications Copyright (C) 2019 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -40,7 +41,6 @@
         <dependency>
             <groupId>org.glassfish.jersey.core</groupId>
             <artifactId>jersey-server</artifactId>
-            <version>${jersey.version}</version>
         </dependency>
         <dependency>
             <groupId>com.google.code.gson</groupId>
index d37cf5a..334e152 100644 (file)
@@ -2,6 +2,7 @@
   ============LICENSE_START=======================================================
    Copyright (C) 2018 Ericsson. All rights reserved.
    Modifications Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+   Modifications Copyright (C) 2019 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -36,9 +37,7 @@
     <description>Endpoints</description>
 
     <properties>
-        <jersey.swagger.version>1.5.18</jersey.swagger.version>
         <cambria.version>1.2.1-oss</cambria.version>
-        <jackson.version>2.9.5</jackson.version>
         <http.client.version>4.5.5</http.client.version>
         <http.core.version>4.4.4</http.core.version>
     </properties>
         <dependency>
             <groupId>org.glassfish.jersey.core</groupId>
             <artifactId>jersey-server</artifactId>
-            <version>${jersey.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.glassfish.jersey.containers</groupId>
             <artifactId>jersey-container-servlet-core</artifactId>
-            <version>${jersey.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.glassfish.jersey.containers</groupId>
             <artifactId>jersey-container-jetty-http</artifactId>
-            <version>${jersey.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.eclipse.jetty</groupId>
-                    <artifactId>jetty-util</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
 
         <dependency>
             <groupId>org.glassfish.jersey.core</groupId>
             <artifactId>jersey-client</artifactId>
-            <version>${jersey.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.glassfish.jersey.core</groupId>
             <artifactId>jersey-common</artifactId>
-            <version>${jersey.version}</version>
         </dependency>
 
         <dependency>
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-annotations</artifactId>
-            <version>${jackson.version}</version>
         </dependency>
 
         <dependency>
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>org.glassfish.jersey.inject</groupId>
+            <artifactId>jersey-hk2</artifactId>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>com.openpojo</groupId>
             <artifactId>openpojo</artifactId>
index 4b73c5c..8a71771 100644 (file)
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,7 +55,7 @@ public class JerseyClient implements HttpClient {
     private static Logger logger = LoggerFactory.getLogger(JerseyClient.class);
 
     protected static final String JERSEY_DEFAULT_SERIALIZATION_PROVIDER =
-                    "com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider";
+                    "org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider";
 
     protected final String name;
     protected final boolean https;
index 78661a4..d809479 100644 (file)
@@ -3,6 +3,7 @@
  * policy-endpoints
  * ================================================================================
  * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,11 +33,10 @@ import org.slf4j.LoggerFactory;
 /**
  * REST Jetty Server that uses Jersey Servlets to support JAX-RS Web Services.
  *
- * <p>Note: the serialization provider will always be added to the server's class providers,
- * as will the swagger providers (assuming swagger has been enabled). This happens whether
- * {@link #addServletClass(String, String)} is used or
- * {@link #addServletPackage(String, String)} is used. Thus it's possible to have both the
- * server's class provider property and the server's package provider property populated.
+ * <p>Note: the serialization provider will always be added to the server's class providers, as will the swagger
+ * providers (assuming swagger has been enabled). This happens whether {@link #addServletClass(String, String)} is used
+ * or {@link #addServletPackage(String, String)} is used. Thus it's possible to have both the server's class provider
+ * property and the server's package provider property populated.
  */
 public class JettyJerseyServer extends JettyServletServer {
 
@@ -64,7 +64,7 @@ public class JettyJerseyServer extends JettyServletServer {
      * Jersey Jackson Classes Init Param Value.
      */
     protected static final String JERSEY_JACKSON_INIT_CLASSNAMES_PARAM_VALUE =
-            "com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider";
+            "org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider";
 
     /**
      * Jersey Swagger Classes Init Param Value.
@@ -149,7 +149,7 @@ public class JettyJerseyServer extends JettyServletServer {
         return servlets.computeIfAbsent(servletPath, key -> {
 
             ServletHolder jerseyServlet =
-                            context.addServlet(org.glassfish.jersey.servlet.ServletContainer.class, servletPath);
+                    context.addServlet(org.glassfish.jersey.servlet.ServletContainer.class, servletPath);
             jerseyServlet.setInitOrder(0);
 
             return jerseyServlet;
@@ -217,9 +217,9 @@ public class JettyJerseyServer extends JettyServletServer {
     }
 
     /**
-     * Adds "standard" parameters to the initParameter set. Sets swagger parameters, if
-     * specified, and sets the class provider property. This can be invoked multiple
-     * times, but only the first actually causes any changes to the parameter set.
+     * Adds "standard" parameters to the initParameter set. Sets swagger parameters, if specified, and sets the class
+     * provider property. This can be invoked multiple times, but only the first actually causes any changes to the
+     * parameter set.
      *
      * @param jerseyServlet servlet into which parameters should be added
      */
@@ -244,8 +244,8 @@ public class JettyJerseyServer extends JettyServletServer {
     }
 
     /**
-     * Note: this must be invoked <i>before</i> {@link #addServletClass(String, String)}
-     * or {@link #addServletPackage(String, String)}.
+     * Note: this must be invoked <i>before</i> {@link #addServletClass(String, String)} or
+     * {@link #addServletPackage(String, String)}.
      */
     @Override
     public void setSerializationProvider(String provider) {
index 55efd8b..8c4eea5 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +21,6 @@
 
 package org.onap.policy.common.endpoints.http.server.test;
 
-import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -28,9 +28,12 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
+
 import lombok.AccessLevel;
 import lombok.Setter;
 
+import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider;
+
 /**
  * JacksonJsonProvider that tracks activities.
  */
diff --git a/pom.xml b/pom.xml
index 78ca05a..8ce2e15 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -3,6 +3,7 @@
   ONAP policy
   ================================================================================
   Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+  Modifications Copyright (C) 2019 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -24,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.parent</groupId>
         <artifactId>integration</artifactId>
-        <version>3.0.1</version>
+        <version>3.1.0-SNAPSHOT</version>
         <relativePath />
     </parent>
 
@@ -59,7 +60,6 @@
 
         <!-- Project common dependency versions -->
         <commons-lang3.version>3.4</commons-lang3.version>
-        <jersey.version>2.25.1</jersey.version>
     </properties>
 
     <modules>