Skip to content

Commit

Permalink
RANGER-2317: Upgrade librarias to become compatible with JDK11, and J…
Browse files Browse the repository at this point in the history
…AXB 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)
  • Loading branch information
gzsombor committed Mar 13, 2019
1 parent a98bc87 commit 08f32cd
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 45 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion embeddedwebserver/scripts/ranger-admin-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions enunciate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
</modules>
<api-classes>
<include pattern="org.apache.hadoop.crypto.key.kms.server.*"/>
<include pattern="org.apache.ranger.**"/>
</api-classes>
</enunciate>
4 changes: 4 additions & 0 deletions hbase-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
12 changes: 7 additions & 5 deletions kms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@
<groupId>org.mockito</groupId>
<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>
Expand Down Expand Up @@ -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>
Expand Down
10 changes: 10 additions & 0 deletions knox-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
<artifactId>javax.servlet-api</artifactId>
<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>
Expand Down
6 changes: 6 additions & 0 deletions plugin-solr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
25 changes: 21 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions ranger-hbase-plugin-shim/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions ranger-solr-plugin-shim/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
26 changes: 21 additions & 5 deletions security-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -56,7 +57,7 @@ public void testBuilderPasswd() throws Throwable {
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")));

}

Expand All @@ -74,7 +75,7 @@ public void testBuilderNss() throws Throwable {
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
Expand Down Expand Up @@ -124,7 +125,7 @@ public void testUnixPasswdAndGroupFile() throws Throwable {
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")));

}

Expand Down

0 comments on commit 08f32cd

Please sign in to comment.