Support Utils Libraries for CL Lab Integration 95/9595/2
authorJorge Hernandez <jh1730@att.com>
Thu, 31 Aug 2017 05:09:45 +0000 (00:09 -0500)
committerJorge Hernandez <jh1730@att.com>
Thu, 31 Aug 2017 05:13:16 +0000 (00:13 -0500)
There is a companion review in the drools-applications repo.

This also includes workarounds to the recent oparent dependency
introduction that breaks runtime (with the version-check-maven-plugin).

It manifested by loading control loops and failing to load some classes
due to different versions (in a lab environment).

The issue was that underlying drools libraries use 3.2.5 and oparent
has included a had dependency with transitive dependencies for some maven
libraries in 3.2.3 and lower version xml parsers.   Bottomoline, the
classpath at runtime was formed by the union of both, with some
libraries being resolved to the oparent one, and others to the drools
one.   These errors are very obscured to debug.

Additional clean up of dependencies versions and order of build
was introduced to avoid issues loading dependencies at runtime in a
lab environment (non-junit)..

Change-Id: If4f4201e08f7e6e1f3619f557434c1b2e23e47a5
Issue-ID: POLICY-162
Signed-off-by: Jorge Hernandez <jh1730@att.com>
policy-core/pom.xml
policy-management/pom.xml
policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
policy-management/src/main/server/config/system.properties
pom.xml

index 8fdfaa3..076a4bf 100644 (file)
       <groupId>org.kie</groupId>
       <artifactId>kie-ci</artifactId>
       <version>6.5.0.Final</version>
-      <scope>runtime</scope>
     </dependency>
     <dependency>
       <groupId>org.drools</groupId>
       <artifactId>drools-core</artifactId>
       <version>6.5.0.Final</version>
-      <scope>runtime</scope>
     </dependency>
     <dependency>
       <groupId>org.drools</groupId>
index b01668b..6391492 100644 (file)
                <artifactId>eclipselink</artifactId>
        </dependency>
        
+       <dependency>
+               <groupId>org.eclipse.persistence</groupId>
+               <artifactId>org.eclipse.persistence.jpa</artifactId>
+       </dependency>
+       
        <dependency>
            <groupId>org.mariadb.jdbc</groupId>
            <artifactId>mariadb-java-client</artifactId>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
        </dependency>
+       
+       <dependency>
+           <groupId>commons-io</groupId>
+           <artifactId>commons-io</artifactId>
+       </dependency>
                        
   </dependencies>
 
index d877f1e..379ca6a 100644 (file)
@@ -2299,6 +2299,7 @@ public class RestManager {
     
     @GET
     @Path("engine/tools/loggers/{logger}")
+    @Produces(MediaType.TEXT_PLAIN)
     @ApiOperation(
                value="logging level of a logger"
     )
@@ -2326,6 +2327,8 @@ public class RestManager {
     
     @PUT
     @Path("engine/tools/loggers/{logger}/{level}")
+    @Produces(MediaType.TEXT_PLAIN)
+    @Consumes(MediaType.TEXT_PLAIN)
     @ApiOperation(
                value="sets the logger level", 
                notes="Please use the SLF4J logger levels"
index d7e0ecd..bfda245 100644 (file)
@@ -429,11 +429,11 @@ class PolicyEngineManager implements PolicyEngine {
                defaultConfig.put(PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + 
                                                                   TELEMETRY_SERVER_DEFAULT_NAME +
                                                                        PolicyProperties.PROPERTY_HTTP_SWAGGER_SUFFIX,
-                                                                       true);
+                                                                       "" + Boolean.TRUE);
                defaultConfig.put(PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + 
                                                   TELEMETRY_SERVER_DEFAULT_NAME +
                                                        PolicyProperties.PROPERTY_MANAGED_SUFFIX,
-                                                       false);
+                                                       "" + Boolean.FALSE);
                
                return defaultConfig;
        }
index 6456ef5..a968b10 100644 (file)
 
 # jmx
 
-com.sun.management.jmxremote.port = 9991
-com.sun.management.jmxremote.authenticate = false
-com.sun.management.jmxremote.ssl = false
+com.sun.management.jmxremote.port=9991
+com.sun.management.jmxremote.authenticate=false
+com.sun.management.jmxremote.ssl=false
 
 # certs
 
 javax.net.ssl.keyStore=/opt/app/policy/etc/ssl/policy-keystore
-javax.net.ssl.keyStorePassword = ${{KEYSTORE_PASSWD}}
+javax.net.ssl.keyStorePassword=${{KEYSTORE_PASSWD}}
 javax.net.ssl.trustStore=/opt/app/policy/etc/ssl/policy-keystore
-javax.net.ssl.trustStorePassword = ${{KEYSTORE_PASSWD}}
+javax.net.ssl.trustStorePassword=${{KEYSTORE_PASSWD}}
 
 # standard logging
 
-logback.configurationFile=config/logback.xml
\ No newline at end of file
+logback.configurationFile=config/logback.xml
diff --git a/pom.xml b/pom.xml
index f3f1460..43a090e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                <jersey.version>2.22.2</jersey.version>
                <jersey.swagger.version>1.5.13</jersey.swagger.version>
                <jackson.version>2.8.4</jackson.version>
-               <http.client.version>4.5</http.client.version>
+               <http.client.version>4.5.2</http.client.version>
                <http.core.version>4.4.4</http.core.version>
                <logback.version>1.2.3</logback.version>
                <junit.version>4.12</junit.version>
-               <eclipselink.version>2.6.4</eclipselink.version>
+               <eclipselink.version>2.7.0</eclipselink.version>
                <mariadb.jdbc.version>2.1.0</mariadb.jdbc.version>
                <hibernate.core.version>5.2.10.Final</hibernate.core.version>
                <hibernate.commons.annotations.version>5.0.1.Final</hibernate.commons.annotations.version>
+               <commons.io.version>2.5</commons.io.version>
+               <guava.version>16.0.1</guava.version>
 
                <nexusproxy>https://nexus.onap.org</nexusproxy>
                <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath>
                </site>
        </distributionManagement>
 
-       <dependencies/>
-
        <dependencyManagement>
                <dependencies>
                        <dependency>
                                <groupId>com.google.guava</groupId>
                                <artifactId>guava</artifactId>
-                               <version>16.0.1</version>
+                               <version>${guava.version}</version>
                        </dependency>
                        <dependency>
                                <groupId>javax.ws.rs</groupId>
                                <artifactId>eclipselink</artifactId>
                                <version>${eclipselink.version}</version>
                        </dependency>
+                       <dependency>
+                               <groupId>org.eclipse.persistence</groupId>
+                               <artifactId>org.eclipse.persistence.jpa</artifactId>
+                               <version>${eclipselink.version}</version>
+                       </dependency>
                        <dependency>
                            <groupId>org.mariadb.jdbc</groupId>
                            <artifactId>mariadb-java-client</artifactId>
                            <artifactId>hibernate-commons-annotations</artifactId>
                            <version>${hibernate.commons.annotations.version}</version>
                        </dependency>
+                       <dependency>
+                           <groupId>commons-io</groupId>
+                           <artifactId>commons-io</artifactId>
+                           <version>${commons.io.version}</version>
+                       </dependency>
                </dependencies>
        </dependencyManagement>
+       
+       <dependencies>
+               <dependency>
+                       <groupId>org.onap.oparent</groupId>
+                       <artifactId>version-check-maven-plugin</artifactId>
+                       <version>1.0.0-SNAPSHOT</version>
+                       <scope>provided</scope>
+                       <optional>true</optional>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>*</groupId>
+                                       <artifactId>*</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+       </dependencies>
 
        <build>
                <plugins>
                        <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-site-plugin</artifactId>
-                         <version>3.6</version>
                          <dependencies>
                            <dependency>
                              <groupId>org.apache.maven.wagon</groupId>
                        <plugin>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>sonar-maven-plugin</artifactId>
+                       </plugin>       
+                       
+                       <plugin>
+                               <groupId>org.onap.oparent</groupId>
+                               <artifactId>version-check-maven-plugin</artifactId>
+                               <executions>
+                                    <execution>
+                                      <id>version-check</id>
+                                      <phase/>
+                                    </execution>    
+                               </executions>
                        </plugin>
+
                </plugins>
                <pluginManagement>
                        <plugins>