HBASE-21808 Ensure we can build with JDK11 targetting JDK8

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

View File

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

View File

@ -42,8 +42,11 @@
<outputDirectory>lib</outputDirectory> <outputDirectory>lib</outputDirectory>
<dependencySets> <dependencySets>
<dependencySet> <dependencySet>
<!-- Exclude libraries that we put in their own dirs under lib/ -->
<excludes> <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>org.jruby:jruby-complete</exclude>
<exclude>com.sun.jersey:*</exclude> <exclude>com.sun.jersey:*</exclude>
<exclude>com.sun.jersey.contribs:*</exclude> <exclude>com.sun.jersey.contribs:*</exclude>

View File

@ -63,8 +63,11 @@
<unpack>false</unpack> <unpack>false</unpack>
<dependencySets> <dependencySets>
<dependencySet> <dependencySet>
<!-- Exclude libraries that we put in their own dirs under lib/ -->
<excludes> <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>org.jruby:jruby-complete</exclude>
<exclude>com.sun.jersey:*</exclude> <exclude>com.sun.jersey:*</exclude>
<exclude>com.sun.jersey.contribs:*</exclude> <exclude>com.sun.jersey.contribs:*</exclude>

View File

@ -293,8 +293,19 @@
<skipTests>true</skipTests> <skipTests>true</skipTests>
</properties> </properties>
</profile> </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 for building against Hadoop 2.x. This is the default -->
<profile> <profile>
<id>hadoop-2.0</id> <id>hadoop-2.0</id>

View File

@ -153,6 +153,8 @@
</relocations> </relocations>
<artifactSet> <artifactSet>
<excludes> <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 protobuf itself. We get a patched version from hbase-thirdparty.
--> -->
<exclude>org.apache.hbase.thirdparty:*</exclude> <exclude>org.apache.hbase.thirdparty:*</exclude>
@ -266,5 +268,17 @@
<surefire.skipSecondPart>true</surefire.skipSecondPart> <surefire.skipSecondPart>true</surefire.skipSecondPart>
</properties> </properties>
</profile> </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> </profiles>
</project> </project>

View File

@ -135,5 +135,17 @@
<surefire.skipSecondPart>true</surefire.skipSecondPart> <surefire.skipSecondPart>true</surefire.skipSecondPart>
</properties> </properties>
</profile> </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> </profiles>
</project> </project>

View File

@ -54,6 +54,8 @@
<configuration> <configuration>
<artifactSet> <artifactSet>
<excludes> <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 Tell the shade plugin that in this case we want to include hadoop
by leaving out the exclude. by leaving out the exclude.

View File

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

25
pom.xml
View File

@ -1478,7 +1478,7 @@
<maven.antrun.version>1.8</maven.antrun.version> <maven.antrun.version>1.8</maven.antrun.version>
<maven.bundle.version>3.3.0</maven.bundle.version> <maven.bundle.version>3.3.0</maven.bundle.version>
<maven.checkstyle.version>3.0.0</maven.checkstyle.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.dependency.version>3.0.1</maven.dependency.version>
<maven.eclipse.version>2.10</maven.eclipse.version> <maven.eclipse.version>2.10</maven.eclipse.version>
<maven.install.version>2.5.2</maven.install.version> <maven.install.version>2.5.2</maven.install.version>
@ -2255,7 +2255,7 @@
<profile> <profile>
<id>build-with-jdk8</id> <id>build-with-jdk8</id>
<activation> <activation>
<jdk>1.8</jdk> <jdk>[1.8,)</jdk>
</activation> </activation>
<build> <build>
<pluginManagement> <pluginManagement>
@ -2283,6 +2283,27 @@
</pluginManagement> </pluginManagement>
</build> </build>
</profile> </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 activated by the Jenkins patch testing job -->
<profile> <profile>
<id>jenkins.patch</id> <id>jenkins.patch</id>