You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by zs...@apache.org on 2019/03/13 09:28:23 UTC

[ranger] branch master updated: RANGER-2317: Upgrade librarias to become compatible with JDK11, and JAXB and other librarias to the modules, and exclude jdk.tools. (These modules was previously part of the JDK, now they are independent). Add JDK10/11 to the travis build - with excluding the Hive tests, as we can't even start the Hive tests on JDK 9 (Fix the enunciate docs generation)

This is an automated email from the ASF dual-hosted git repository.

zsombor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 08f32cd  RANGER-2317: Upgrade librarias to become compatible with JDK11, and JAXB and other librarias to the modules, and exclude jdk.tools.  (These modules was previously part of the JDK, now they are independent).  Add JDK10/11 to the travis build - with excluding the Hive tests, as we can't even start the Hive tests on JDK 9  (Fix the enunciate docs generation)
08f32cd is described below

commit 08f32cd35824399eaac573f47338fbe8433ed97e
Author: Zsombor Gegesy <zs...@apache.org>
AuthorDate: Sun Dec 30 09:35:09 2018 +0100

    RANGER-2317: Upgrade librarias to become compatible with JDK11, and JAXB and other librarias to the modules, and exclude jdk.tools.
     (These modules was previously part of the JDK, now they are independent).
     Add JDK10/11 to the travis build - with excluding the Hive tests, as we can't even start the Hive tests on JDK 9
     (Fix the enunciate docs generation)
---
 .travis.yml                                        |  8 ++++++-
 embeddedwebserver/scripts/ranger-admin-services.sh |  2 +-
 enunciate.xml                                      |  1 +
 hbase-agent/pom.xml                                |  4 ++++
 kms/pom.xml                                        | 12 +++++-----
 knox-agent/pom.xml                                 | 10 +++++++++
 plugin-solr/pom.xml                                |  6 +++++
 pom.xml                                            | 25 +++++++++++++++++----
 ranger-hbase-plugin-shim/pom.xml                   |  6 +++++
 ranger-solr-plugin-shim/pom.xml                    |  6 +++++
 security-admin/pom.xml                             | 26 +++++++++++++++++-----
 .../apache/ranger/plugin/store/RangerDBStore.java  | 26 ----------------------
 .../process/TestUnixUserGroupBuilder.java          |  7 +++---
 13 files changed, 94 insertions(+), 45 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index b38b892..deac951 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,6 +21,10 @@ cache:
   - $HOME/.m2
 jdk:
   - oraclejdk8
+  - oraclejdk11
+  - openjdk10
+  - openjdk11
+
 env:
   - KEY=default VALUE=default
 # Environment to testing with different versions, disabled because ranger is not compatible
@@ -34,6 +38,8 @@ install:
 
 # KafkaRangerAuthorizerGSSTest is a failing test, TestLdapUserGroup needs too much memory for travis
 script:
-  - mvn test -D$KEY=$VALUE -Dmaven.javadoc.skip=true -B -V -pl !plugin-kafka,!ugsync
+  - mvn test -D$KEY=$VALUE -Dmaven.javadoc.skip=true -B -V -pl !plugin-kafka,!ugsync,!hive-agent
   - mvn test -D$KEY=$VALUE -Dmaven.javadoc.skip=true -B -V -pl plugin-kafka -Dtest="*,!KafkaRangerAuthorizerGSSTest"
   - mvn test -D$KEY=$VALUE -Dmaven.javadoc.skip=true -B -V -pl ugsync -Dtest="*,!TestLdapUserGroup"
+  - if [[ "$TRAVIS_JDK_VERSION" != "oraclejdk8" ]]; then mvn test -D$KEY=$VALUE -Dmaven.javadoc.skip=true -B -V -pl hive-agent -Dtest="*,!HIVERangerAuthorizerTest" -DfailIfNoTests=false ; fi
+  - if [[ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ]]; then mvn test -D$KEY=$VALUE -Dmaven.javadoc.skip=true -B -V -pl hive-agent ; fi
diff --git a/embeddedwebserver/scripts/ranger-admin-services.sh b/embeddedwebserver/scripts/ranger-admin-services.sh
index c04e1fc..8f148a7 100755
--- a/embeddedwebserver/scripts/ranger-admin-services.sh
+++ b/embeddedwebserver/scripts/ranger-admin-services.sh
@@ -44,7 +44,7 @@ for custom_env_script in `find ${XAPOLICYMGR_DIR}/ews/webapp/WEB-INF/classes/con
         fi
 done
 
-JAVA_OPTS=" ${JAVA_OPTS} -XX:MetaspaceSize=100m -XX:MaxMetaspaceSize=200m -Xmx${ranger_admin_max_heap_size} -Xms1g -Xloggc:${XAPOLICYMGR_EWS_DIR}/logs/gc-worker.log -verbose:gc -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=1m -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCDateStamps"
+JAVA_OPTS=" ${JAVA_OPTS} -XX:MetaspaceSize=100m -XX:MaxMetaspaceSize=200m -Xmx${ranger_admin_max_heap_size} -Xms1g -Xloggc:${XAPOLICYMGR_EWS_DIR}/logs/gc-worker.log -verbose:gc -XX:+PrintGCDetails"
 if [[ ${JAVA_OPTS} != *"-Duser.timezone"* ]] ;then  export JAVA_OPTS=" ${JAVA_OPTS} -Duser.timezone=UTC" ;fi
 
 if [ "$JAVA_HOME" != "" ]; then
diff --git a/enunciate.xml b/enunciate.xml
index f64af1a..13b465b 100644
--- a/enunciate.xml
+++ b/enunciate.xml
@@ -36,5 +36,6 @@
 	</modules>
   <api-classes>
     <include pattern="org.apache.hadoop.crypto.key.kms.server.*"/>
+    <include pattern="org.apache.ranger.**"/>
   </api-classes>
 </enunciate>
diff --git a/hbase-agent/pom.xml b/hbase-agent/pom.xml
index 6b3763f..d0cfec0 100644
--- a/hbase-agent/pom.xml
+++ b/hbase-agent/pom.xml
@@ -41,6 +41,10 @@
                     <groupId>org.apache.hadoop</groupId>
                     <artifactId>*</artifactId>
                 </exclusion>
+                <exclusion>
+                    <groupId>jdk.tools</groupId>
+                    <artifactId>jdk.tools</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
         <dependency>
diff --git a/kms/pom.xml b/kms/pom.xml
index 59dd276..8c53584 100644
--- a/kms/pom.xml
+++ b/kms/pom.xml
@@ -106,6 +106,11 @@
             <artifactId>mockito-core</artifactId>
         </dependency>
         <dependency>
+            <groupId>javax.annotation</groupId>
+            <artifactId>jsr250-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.hadoop</groupId>
             <artifactId>hadoop-auth</artifactId>
             <version>${hadoop.version}</version>
@@ -273,11 +278,8 @@
                     <groupId>com.webcohesion.enunciate</groupId>
                     <artifactId>enunciate-maven-plugin</artifactId>
                     <configuration>
-                        <configFile>enunciate.xml</configFile>
-                        <enunciateArtifactId/>
-                        <docsDir>docs/target/kms/</docsDir>
-                        <source>1.8</source>
-                        <target>1.8</target>
+                        <configFile>${basedir}/../enunciate.xml</configFile>
+                        <docsDir>${basedir}/../docs/target/kms/</docsDir>
                     </configuration>
                 </plugin>
             </plugins>
diff --git a/knox-agent/pom.xml b/knox-agent/pom.xml
index bd68221..a01fdc6 100644
--- a/knox-agent/pom.xml
+++ b/knox-agent/pom.xml
@@ -42,6 +42,16 @@
             <version>${javax.servlet.version}</version>
         </dependency>
         <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jaxb</groupId>
+            <artifactId>jaxb-runtime</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.glassfish.jersey.core</groupId>
             <artifactId>jersey-client</artifactId>
         </dependency>
diff --git a/plugin-solr/pom.xml b/plugin-solr/pom.xml
index 619cc9e..8aa958c 100644
--- a/plugin-solr/pom.xml
+++ b/plugin-solr/pom.xml
@@ -50,6 +50,12 @@
             <groupId>org.apache.solr</groupId>
             <artifactId>solr-core</artifactId>
             <version>${solr.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>jdk.tools</groupId>
+                    <artifactId>jdk.tools</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
 </project>
diff --git a/pom.xml b/pom.xml
index d5c4e92..256b2f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,6 +109,7 @@
         <derby.version>10.11.1.1</derby.version>
         <eclipse.jpa.version>2.5.2</eclipse.jpa.version>
         <elasticsearch.version>6.2.2</elasticsearch.version>
+        <enunciate.version>2.11.1</enunciate.version>
         <findbugs.plugin.version>3.0.3</findbugs.plugin.version>
         <google.guava.version>25.1-jre</google.guava.version>
         <googlecode.log4jdbc.version>1.2</googlecode.log4jdbc.version>
@@ -126,6 +127,7 @@
         <javax.persistence.version>2.1.0</javax.persistence.version>
         <javax.servlet.version>3.1.0</javax.servlet.version>
         <javax-inject.version>1</javax-inject.version>
+        <jaxb.api.version>2.3.1</jaxb.api.version>
         <jericho.html.version>3.3</jericho.html.version>
         <jersey-bundle.version>1.19.3</jersey-bundle.version>
         <jersey-client.version>2.6</jersey-client.version>
@@ -136,6 +138,7 @@
         <jline.version>0.9.94</jline.version>
         <json4s.version>3.2.11</json4s.version>
         <jsonsmart.version>2.3</jsonsmart.version>
+        <jsr250.version>1.0</jsr250.version>
         <jsr305.version>1.3.9</jsr305.version>
         <junit.version>4.12</junit.version>
         <kafka.version>2.0.0</kafka.version>
@@ -146,7 +149,7 @@
         <local.lib.dir>${project.basedir}/../lib/local</local.lib.dir>
         <log4j.version>1.2.17</log4j.version>
         <metrics.core.version>3.0.2</metrics.core.version>
-        <mockito.version>2.7.22</mockito.version>
+        <mockito.version>2.23.4</mockito.version>
         <mysql-connector-java.version>5.1.31</mysql-connector-java.version>
         <netty.version>3.10.5.Final</netty.version>
         <noggit.version>0.6</noggit.version>
@@ -820,7 +823,7 @@
 			<dependency>
 				<groupId>com.webcohesion.enunciate</groupId>
 				<artifactId>enunciate-core-annotations</artifactId>
-				<version>2.10.1</version>
+				<version>${enunciate.version}</version>
 			</dependency>
 			<dependency>
 				<groupId>commons-beanutils</groupId>
@@ -832,6 +835,21 @@
 				<artifactId>hbase-client</artifactId>
 				<version>${hbase.version}</version>
 			</dependency>
+            <dependency>
+                <groupId>javax.annotation</groupId>
+                <artifactId>jsr250-api</artifactId>
+                <version>${jsr250.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>javax.xml.bind</groupId>
+                <artifactId>jaxb-api</artifactId>
+                <version>${jaxb.api.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.glassfish.jaxb</groupId>
+                <artifactId>jaxb-runtime</artifactId>
+                <version>${jaxb.api.version}</version>
+            </dependency>
 		</dependencies>
     </dependencyManagement>
     <build>
@@ -928,9 +946,8 @@
 				<plugin>
 					<groupId>com.webcohesion.enunciate</groupId>
 					<artifactId>enunciate-maven-plugin</artifactId>
-					<version>2.10.1</version>
+					<version>${enunciate.version}</version>
 					<configuration>
-						<configFile>enunciate.xml</configFile>
 						<enunciateArtifactId/>
 						<docsDir>docs/src/site/</docsDir>
 						<source>1.8</source>
diff --git a/ranger-hbase-plugin-shim/pom.xml b/ranger-hbase-plugin-shim/pom.xml
index 9ed0aeb..c2e12ad 100644
--- a/ranger-hbase-plugin-shim/pom.xml
+++ b/ranger-hbase-plugin-shim/pom.xml
@@ -35,6 +35,12 @@
             <groupId>org.apache.hbase</groupId>
             <artifactId>hbase-server</artifactId>
             <version>${hbase.version}</version>
+            <exclusions>
+                 <exclusion>
+                    <groupId>jdk.tools</groupId>
+                    <artifactId>jdk.tools</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.ranger</groupId>
diff --git a/ranger-solr-plugin-shim/pom.xml b/ranger-solr-plugin-shim/pom.xml
index 46b7821..ead9b95 100644
--- a/ranger-solr-plugin-shim/pom.xml
+++ b/ranger-solr-plugin-shim/pom.xml
@@ -50,6 +50,12 @@
             <groupId>org.apache.solr</groupId>
             <artifactId>solr-core</artifactId>
             <version>${solr.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>jdk.tools</groupId>
+                    <artifactId>jdk.tools</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.ranger</groupId>
diff --git a/security-admin/pom.xml b/security-admin/pom.xml
index 2c58760..1414745 100644
--- a/security-admin/pom.xml
+++ b/security-admin/pom.xml
@@ -500,6 +500,12 @@
             <artifactId>guice</artifactId>
             <version>3.0</version>
         </dependency>
+        <dependency>
+            <groupId>javax.annotation</groupId>
+            <artifactId>jsr250-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
 		<dependency>
 			<groupId>com.webcohesion.enunciate</groupId>
 			<artifactId>enunciate-core-annotations</artifactId>
@@ -607,12 +613,22 @@
 				<groupId>com.webcohesion.enunciate</groupId>
 				<artifactId>enunciate-maven-plugin</artifactId>
 				<configuration>
-					<configFile>enunciate.xml</configFile>
-					<enunciateArtifactId/>
-					<docsDir>docs/target/</docsDir>
-					<source>1.7</source>
-					<target>1.7</target>
+					<configFile>${basedir}/../enunciate.xml</configFile>
+					<docsDir>${basedir}/../docs/target/</docsDir>
 				</configuration>
+                <dependencies>
+                    <!-- dependency management version doesn't apply here, need to repeat the version numbers -->
+                    <dependency>
+                        <groupId>javax.xml.bind</groupId>
+                        <artifactId>jaxb-api</artifactId>
+                        <version>${jaxb.api.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>javax.jws</groupId>
+                        <artifactId>javax.jws-api</artifactId>
+                        <version>1.1</version>
+                    </dependency>
+                </dependencies>
 			</plugin>
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
diff --git a/security-admin/src/test/java/org/apache/ranger/plugin/store/RangerDBStore.java b/security-admin/src/test/java/org/apache/ranger/plugin/store/RangerDBStore.java
deleted file mode 100644
index cd5bb38..0000000
--- a/security-admin/src/test/java/org/apache/ranger/plugin/store/RangerDBStore.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ranger.plugin.store;
-
-import org.junit.runner.RunWith;
-import org.mockito.junit.MockitoJUnitRunner;
-
-@RunWith(MockitoJUnitRunner.class)
-public class RangerDBStore {
-
-}
diff --git a/ugsync/src/test/java/org/apache/ranger/unixusersync/process/TestUnixUserGroupBuilder.java b/ugsync/src/test/java/org/apache/ranger/unixusersync/process/TestUnixUserGroupBuilder.java
index 2118c84..56c3f6a 100644
--- a/ugsync/src/test/java/org/apache/ranger/unixusersync/process/TestUnixUserGroupBuilder.java
+++ b/ugsync/src/test/java/org/apache/ranger/unixusersync/process/TestUnixUserGroupBuilder.java
@@ -20,6 +20,7 @@
 package org.apache.ranger.unixusersync.process;
 
 import org.apache.ranger.unixusersync.config.UserGroupSyncConfig;
+import org.hamcrest.Matcher;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -56,7 +57,7 @@ public class TestUnixUserGroupBuilder {
         Map<String, List<String>> users = builder.getUser2GroupListMap();
         List<String> usergroups = users.get("root");
         assertNotNull(usergroups);
-        assertThat(usergroups, anyOf(hasItem("wheel"), hasItem("root")));
+        assertThat(usergroups, (Matcher)anyOf(hasItem("wheel"), hasItem("root")));
 
     }
 
@@ -74,7 +75,7 @@ public class TestUnixUserGroupBuilder {
         Map<String, List<String>> users = builder.getUser2GroupListMap();
         List<String> usergroups = users.get("root");
         assertNotNull(usergroups);
-        assertThat(usergroups, anyOf(hasItem("wheel"), hasItem("root")));
+        assertThat(usergroups, (Matcher)anyOf(hasItem("wheel"), hasItem("root")));
     }
 
     @Test
@@ -124,7 +125,7 @@ public class TestUnixUserGroupBuilder {
         Map<String, List<String>> users = builder.getUser2GroupListMap();
         List<String> usergroups = users.get("sam");
         assertNotNull(usergroups);
-        assertThat(usergroups, anyOf(hasItem("wheel"), hasItem("sam")));
+        assertThat(usergroups, (Matcher) anyOf(hasItem("wheel"), hasItem("sam")));
 
     }