HBASE-21808 Ensure we can build with JDK11 targetting JDK8

Signed-off-by: Josh Elser <elserj@apache.org>
This commit is contained in:
Sean Busbey 2019-01-30 02:20:33 -06:00
parent 64c32720d6
commit 5784a09fff
9 changed files with 75 additions and 6 deletions

View File

@ -138,6 +138,7 @@
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludeTypes>pom</excludeTypes>
<useSubDirectoryPerArtifact>true</useSubDirectoryPerArtifact>
<includes>**\/NOTICE,**\/NOTICE.txt</includes>
</configuration>

View File

@ -42,8 +42,11 @@
<outputDirectory>lib</outputDirectory>
<dependencySets>
<dependencySet>
<!-- Exclude libraries that we put in their own dirs under lib/ -->
<excludes>
<!-- Exclude J2EE libraries that get pulled in when building on JDK11 -->
<exclude>javax.annotation:javax.annotation-api</exclude>
<exclude>com.sun.xml.ws:jaxws-ri</exclude>
<!-- Exclude libraries that we put in their own dirs under lib/ -->
<exclude>org.jruby:jruby-complete</exclude>
<exclude>com.sun.jersey:*</exclude>
<exclude>com.sun.jersey.contribs:*</exclude>

View File

@ -65,8 +65,11 @@
<unpack>false</unpack>
<dependencySets>
<dependencySet>
<!-- Exclude libraries that we put in their own dirs under lib/ -->
<excludes>
<!-- Exclude J2EE libraries that get pulled in when building on JDK11 -->
<exclude>javax.annotation:javax.annotation-api</exclude>
<exclude>com.sun.xml.ws:jaxws-ri</exclude>
<!-- Exclude libraries that we put in their own dirs under lib/ -->
<exclude>org.jruby:jruby-complete</exclude>
<exclude>com.sun.jersey:*</exclude>
<exclude>com.sun.jersey.contribs:*</exclude>

View File

@ -298,8 +298,19 @@
<skipTests>true</skipTests>
</properties>
</profile>
<profile>
<id>build-with-jdk11</id>
<activation>
<jdk>[1.11,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-ri</artifactId>
<type>pom</type>
</dependency>
</dependencies>
</profile>
<!-- profile for building against Hadoop 2.x. This is the default -->
<profile>
<id>hadoop-2.0</id>

View File

@ -162,6 +162,8 @@
</relocations>
<artifactSet>
<excludes>
<!-- exclude J2EE modules that come in for JDK11+ -->
<exclude>javax.annotation:javax.annotation-api</exclude>
<!--Exclude protobuf itself. We get a patched version from hbase-thirdparty.
-->
<exclude>org.apache.hbase.thirdparty:*</exclude>
@ -275,5 +277,17 @@
<surefire.skipSecondPart>true</surefire.skipSecondPart>
</properties>
</profile>
<profile>
<id>build-with-jdk11</id>
<activation>
<jdk>[1.11,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>

View File

@ -190,5 +190,17 @@
<surefire.skipSecondPart>true</surefire.skipSecondPart>
</properties>
</profile>
<profile>
<id>build-with-jdk11</id>
<activation>
<jdk>[1.11,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>

View File

@ -54,6 +54,8 @@
<configuration>
<artifactSet>
<excludes>
<!-- exclude J2EE modules that come in for JDK11+ -->
<exclude>javax.annotation:javax.annotation-api</exclude>
<!--
Tell the shade plugin that in this case we want to include hadoop
by leaving out the exclude.

View File

@ -132,6 +132,8 @@
<shadeTestJar>false</shadeTestJar>
<artifactSet>
<excludes>
<!-- exclude J2EE modules that come in for JDK11+ -->
<exclude>javax.annotation:javax.annotation-api</exclude>
<!-- default to excluding Hadoop, have module that want
to include it redefine the exclude list -->
<exclude>org.apache.hadoop:*</exclude>

25
pom.xml
View File

@ -1612,7 +1612,7 @@
<maven.antrun.version>1.8</maven.antrun.version>
<maven.bundle.version>3.3.0</maven.bundle.version>
<maven.checkstyle.version>3.0.0</maven.checkstyle.version>
<maven.compiler.version>3.6.1</maven.compiler.version>
<maven.compiler.version>3.8.0</maven.compiler.version>
<maven.dependency.version>3.0.1</maven.dependency.version>
<maven.eclipse.version>2.10</maven.eclipse.version>
<maven.install.version>2.5.2</maven.install.version>
@ -2404,7 +2404,7 @@
<profile>
<id>build-with-jdk8</id>
<activation>
<jdk>1.8</jdk>
<jdk>[1.8,)</jdk>
</activation>
<build>
<pluginManagement>
@ -2432,6 +2432,27 @@
</pluginManagement>
</build>
</profile>
<profile>
<id>build-with-jdk11</id>
<activation>
<jdk>[1.11,)</jdk>
</activation>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-ri</artifactId>
<version>2.3.1</version>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
</profile>
<!-- profile activated by the Jenkins patch testing job -->
<profile>
<id>jenkins.patch</id>