HBASE-20333 Provide a shaded client that allows downstream to provide Hadoop needs.

Signed-off-by: Mike Drob <mdrob@apache.org>
This commit is contained in:
Sean Busbey 2018-04-24 14:51:12 -05:00
parent ee84a8f243
commit e19fdd3903
6 changed files with 116 additions and 32 deletions

View File

@ -48,6 +48,11 @@
<artifactId>hbase-shaded-mapreduce</artifactId> <artifactId>hbase-shaded-mapreduce</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-shaded-client-byo-hadoop</artifactId>
<version>${project.version}</version>
</dependency>
<!-- parent pom defines these for children. :( :( :( --> <!-- parent pom defines these for children. :( :( :( -->
<dependency> <dependency>
<groupId>com.github.stephenc.findbugs</groupId> <groupId>com.github.stephenc.findbugs</groupId>

View File

@ -0,0 +1,70 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.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.
*/
-->
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>hbase-shaded</artifactId>
<groupId>org.apache.hbase</groupId>
<version>2.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>hbase-shaded-client-byo-hadoop</artifactId>
<name>Apache HBase - Shaded - Client</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<!--Make it so assembly:single does nothing in here-->
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<skipAssembly>true</skipAssembly>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -28,7 +28,7 @@
<relativePath>..</relativePath> <relativePath>..</relativePath>
</parent> </parent>
<artifactId>hbase-shaded-client</artifactId> <artifactId>hbase-shaded-client</artifactId>
<name>Apache HBase - Shaded - Client</name> <name>Apache HBase - Shaded - Client (with Hadoop bundled)</name>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@ -51,6 +51,7 @@
<dependency> <dependency>
<groupId>org.apache.hbase</groupId> <groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId> <artifactId>hbase-client</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -62,6 +63,30 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>aggregate-into-a-jar-with-relocated-third-parties</id>
<configuration>
<artifactSet>
<excludes>
<!--
Tell the shade plugin that in this case we want to include hadoop
by leaving out the exclude.
-->
<!-- The rest of these should be kept in sync with the parent pom -->
<exclude>org.apache.hbase:hbase-resource-bundle</exclude>
<exclude>org.slf4j:*</exclude>
<exclude>com.google.code.findbugs:*</exclude>
<exclude>com.github.stephenc.findbugs:*</exclude>
<exclude>org.apache.htrace:*</exclude>
<exclude>org.apache.yetus:*</exclude>
<exclude>log4j:*</exclude>
<exclude>commons-logging:*</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@ -169,31 +169,9 @@
<id>release</id> <id>release</id>
<build> <build>
<plugins> <plugins>
<!-- Tell the shade plugin we want to leave Hadoop as a dependency -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>aggregate-into-a-jar-with-relocated-third-parties</id>
<configuration>
<artifactSet>
<excludes>
<exclude>org.apache.hadoop:*</exclude>
<!-- The rest of these should be kept in sync with the parent pom -->
<exclude>org.apache.hbase:hbase-resource-bundle</exclude>
<exclude>org.slf4j:*</exclude>
<exclude>com.google.code.findbugs:*</exclude>
<exclude>com.github.stephenc.findbugs:*</exclude>
<exclude>org.apache.htrace:*</exclude>
<exclude>org.apache.yetus:*</exclude>
<exclude>log4j:*</exclude>
<exclude>commons-logging:*</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@ -16,7 +16,7 @@
<parent> <parent>
<artifactId>hbase</artifactId> <artifactId>hbase</artifactId>
<groupId>org.apache.hbase</groupId> <groupId>org.apache.hbase</groupId>
<version>3.0.0-SNAPSHOT</version> <version>2.1.0-SNAPSHOT</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<artifactId>hbase-shaded-with-hadoop-check-invariants</artifactId> <artifactId>hbase-shaded-with-hadoop-check-invariants</artifactId>

View File

@ -39,6 +39,7 @@
<shaded.prefix>org.apache.hadoop.hbase.shaded</shaded.prefix> <shaded.prefix>org.apache.hadoop.hbase.shaded</shaded.prefix>
</properties> </properties>
<modules> <modules>
<module>hbase-shaded-client-byo-hadoop</module>
<module>hbase-shaded-client</module> <module>hbase-shaded-client</module>
<module>hbase-shaded-mapreduce</module> <module>hbase-shaded-mapreduce</module>
<module>hbase-shaded-check-invariants</module> <module>hbase-shaded-check-invariants</module>
@ -131,6 +132,11 @@
<shadeTestJar>false</shadeTestJar> <shadeTestJar>false</shadeTestJar>
<artifactSet> <artifactSet>
<excludes> <excludes>
<!-- default to excluding Hadoop, have module that want
to include it redefine the exclude list -->
<exclude>org.apache.hadoop:*</exclude>
<!-- the rest of this needs to be kept in sync with any
hadoop-including module -->
<exclude>org.apache.hbase:hbase-resource-bundle</exclude> <exclude>org.apache.hbase:hbase-resource-bundle</exclude>
<exclude>org.slf4j:*</exclude> <exclude>org.slf4j:*</exclude>
<exclude>com.google.code.findbugs:*</exclude> <exclude>com.google.code.findbugs:*</exclude>