HBASE-25890 [Addendum] create profiles for different jdk version (#3295)

This commit is contained in:
Reid Chan 2021-05-25 23:19:32 +08:00 committed by GitHub
parent 3cff107a5f
commit c0ee153c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 298 additions and 36 deletions

View File

@ -167,11 +167,6 @@
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-rest</artifactId>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-thrift</artifactId>
<optional>true</optional>
</dependency>
<!-- To dump tools in hbase-procedure into cached_classpath.txt. -->
<dependency>
<groupId>org.apache.hbase</groupId>
@ -233,4 +228,21 @@
<version>${project.version}</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>build-with-jdk8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-thrift</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,142 @@
<?xml version="1.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.
*/
-->
<!--Shared. Does common copying-->
<component>
<fileSets>
<!--Copy over the site if built as docs dir -->
<fileSet>
<directory>${project.basedir}/../target/site</directory>
<outputDirectory>docs</outputDirectory>
</fileSet>
<!-- Include top level text files-->
<fileSet>
<directory>${project.basedir}/..</directory>
<outputDirectory>.</outputDirectory>
<includes>
<include>CHANGES.txt</include>
<include>README.txt</include>
</includes>
<fileMode>0644</fileMode>
</fileSet>
<!-- Include the top level conf directory -->
<fileSet>
<directory>${project.basedir}/../conf</directory>
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
<!-- Include top level bin directory -->
<!-- First copy all but the *.cmd files-->
<fileSet>
<directory>${project.basedir}/../bin</directory>
<outputDirectory>bin</outputDirectory>
<excludes>
<exclude>**/*.cmd</exclude>
</excludes>
<fileMode>0755</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
<!--Now do the cmd files; we do not want these executable.-->
<fileSet>
<directory>${project.basedir}/../bin</directory>
<outputDirectory>bin</outputDirectory>
<includes>
<include>**/*.cmd</include>
</includes>
</fileSet>
<!-- Move the ruby code over -->
<fileSet>
<directory>${project.basedir}/../hbase-shell/src/main/ruby</directory>
<outputDirectory>lib/ruby</outputDirectory>
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
<!-- Move the webapps to the webapp dir -->
<fileSet>
<directory>${project.basedir}/../hbase-server/target/hbase-webapps</directory>
<outputDirectory>hbase-webapps</outputDirectory>
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/../hbase-thrift/target/hbase-webapps</directory>
<outputDirectory>hbase-webapps/</outputDirectory>
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/../hbase-rest/target/hbase-webapps</directory>
<outputDirectory>hbase-webapps/</outputDirectory>
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
<!-- Include native libraries -->
<fileSet>
<directory>${project.basedir}/../hbase-server/target/native</directory>
<outputDirectory>lib/native</outputDirectory>
<fileMode>0755</fileMode>
<directoryMode>0755</directoryMode>
<includes>
<include>*.so</include>
<include>*.dylib</include>
</includes>
</fileSet>
<!-- This is only necessary until maven fixes the intra-project dependency bug
in maven 3.0. Until then, we have to include the test jars for sub-projects. When
fixed, the below dependencySet stuff is sufficient for pulling in the test jars as
well, as long as they are added as dependencies in this project. Right now, we only
have 1 submodule to accumulate, but we can copy/paste as necessary until maven is
fixed. -->
<fileSet>
<directory>${project.basedir}/../hbase-server/target/</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>${server.test.jar}</include>
</includes>
<fileMode>0644</fileMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/../hbase-it/target/</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>${it.test.jar}</include>
</includes>
<fileMode>0644</fileMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/../hbase-annotations/target/</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>${annotations.test.jar}</include>
</includes>
<fileMode>0644</fileMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/../hbase-common/target/</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>${common.test.jar}</include>
</includes>
<fileMode>0644</fileMode>
</fileSet>
</fileSets>
</component>

View File

@ -77,12 +77,6 @@
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/../hbase-thrift/target/hbase-webapps</directory>
<outputDirectory>hbase-webapps/</outputDirectory>
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/../hbase-rest/target/hbase-webapps</directory>
<outputDirectory>hbase-webapps/</outputDirectory>

View File

@ -0,0 +1,82 @@
<?xml version="1.0"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd">
<!--
/**
* 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.
*/
-->
<!--This 'all' id is not appended to the produced bundle because we do this: http://maven.apache.org/plugins/maven-assembly-plugin/faq.html#required-classifiers -->
<id>bin</id>
<formats>
<format>tar.gz</format>
</formats>
<componentDescriptors>
<componentDescriptor>src/main/assembly/components-jdk8.xml</componentDescriptor>
</componentDescriptors>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>org.apache.hbase:hbase-annotations</include>
<include>org.apache.hbase:hbase-client</include>
<include>org.apache.hbase:hbase-common</include>
<include>org.apache.hbase:hbase-examples</include>
<include>org.apache.hbase:hbase-hadoop2-compat</include>
<include>org.apache.hbase:hbase-hadoop-compat</include>
<include>org.apache.hbase:hbase-it</include>
<include>org.apache.hbase:hbase-prefix-tree</include>
<include>org.apache.hbase:hbase-procedure</include>
<include>org.apache.hbase:hbase-protocol</include>
<include>org.apache.hbase:hbase-rest</include>
<include>org.apache.hbase:hbase-server</include>
<include>org.apache.hbase:hbase-shell</include>
<include>org.apache.hbase:hbase-thrift</include>
<include>org.apache.hbase:hbase-external-blockcache</include>
</includes>
<!-- Binaries for the dependencies also go in the hbase-jars directory -->
<binaries>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
<dependencySets>
<dependencySet/>
</dependencySets>
</binaries>
</moduleSet>
</moduleSets>
<!-- Include the generated LICENSE and NOTICE files -->
<files>
<file>
<source>${project.build.directory}/maven-shared-archive-resources/META-INF/LICENSE</source>
<outputDirectory>.</outputDirectory>
<destName>LICENSE.txt</destName>
<lineEnding>unix</lineEnding>
</file>
<file>
<source>${project.build.directory}/NOTICE.aggregate</source>
<outputDirectory>.</outputDirectory>
<destName>NOTICE.txt</destName>
<lineEnding>unix</lineEnding>
</file>
<file>
<source>${basedir}/src/main/resources/META-INF/LEGAL</source>
<outputDirectory>.</outputDirectory>
<destName>LEGAL</destName>
<lineEnding>unix</lineEnding>
</file>
</files>
</assembly>

View File

@ -45,7 +45,6 @@
<include>org.apache.hbase:hbase-rest</include>
<include>org.apache.hbase:hbase-server</include>
<include>org.apache.hbase:hbase-shell</include>
<include>org.apache.hbase:hbase-thrift</include>
<include>org.apache.hbase:hbase-external-blockcache</include>
</includes>
<!-- Binaries for the dependencies also go in the hbase-jars directory -->

81
pom.xml
View File

@ -60,30 +60,6 @@
</license>
</licenses>
<modules>
<module>hbase-resource-bundle</module>
<module>hbase-server</module>
<module>hbase-rest</module>
<module>hbase-shell</module>
<module>hbase-protocol</module>
<module>hbase-client</module>
<module>hbase-hadoop-compat</module>
<module>hbase-common</module>
<module>hbase-procedure</module>
<module>hbase-it</module>
<module>hbase-examples</module>
<module>hbase-prefix-tree</module>
<module>hbase-assembly</module>
<module>hbase-testing-util</module>
<module>hbase-annotations</module>
<module>hbase-checkstyle</module>
<module>hbase-external-blockcache</module>
<module>hbase-shaded</module>
<module>hbase-archetypes</module>
<module>hbase-metrics-api</module>
<module>hbase-metrics</module>
<module>hbase-hbtop</module>
</modules>
<!--Add apache snapshots in case we want to use unreleased versions of plugins:
e.g. surefire 2.18-SNAPSHOT-->
<pluginRepositories>
@ -2032,8 +2008,33 @@
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<assembly.file>src/main/assembly/hadoop-two-compat-jdk8.xml</assembly.file>
</properties>
<modules>
<module>hbase-resource-bundle</module>
<module>hbase-server</module>
<module>hbase-rest</module>
<module>hbase-thrift</module>
<module>hbase-shell</module>
<module>hbase-protocol</module>
<module>hbase-client</module>
<module>hbase-hadoop-compat</module>
<module>hbase-common</module>
<module>hbase-procedure</module>
<module>hbase-it</module>
<module>hbase-examples</module>
<module>hbase-prefix-tree</module>
<module>hbase-assembly</module>
<module>hbase-testing-util</module>
<module>hbase-annotations</module>
<module>hbase-checkstyle</module>
<module>hbase-external-blockcache</module>
<module>hbase-shaded</module>
<module>hbase-archetypes</module>
<module>hbase-metrics-api</module>
<module>hbase-metrics</module>
<module>hbase-hbtop</module>
</modules>
<build>
<pluginManagement>
@ -2062,6 +2063,38 @@
</build>
</profile>
<profile>
<id>build-with-jdk7</id>
<activation>
<jdk>1.7</jdk>
</activation>
<modules>
<!-- without hbase-thrift module -->
<module>hbase-resource-bundle</module>
<module>hbase-server</module>
<module>hbase-rest</module>
<module>hbase-shell</module>
<module>hbase-protocol</module>
<module>hbase-client</module>
<module>hbase-hadoop-compat</module>
<module>hbase-common</module>
<module>hbase-procedure</module>
<module>hbase-it</module>
<module>hbase-examples</module>
<module>hbase-prefix-tree</module>
<module>hbase-assembly</module>
<module>hbase-testing-util</module>
<module>hbase-annotations</module>
<module>hbase-checkstyle</module>
<module>hbase-external-blockcache</module>
<module>hbase-shaded</module>
<module>hbase-archetypes</module>
<module>hbase-metrics-api</module>
<module>hbase-metrics</module>
<module>hbase-hbtop</module>
</modules>
</profile>
<!--In JDK 1.8 and newer the PermGem has been removed. -->
<!--These two profiles are to handle the differences between the before and after 1.8 -->
<profile>