Skip to content
Permalink
Browse files
HBASE-22393 HBOSS: Shaded external dependencies to avoid conflicts wi…
…th Hadoop and HBase.

Closes #2

Signed-off-by: Josh Elser <elserj@apache.org>
Co-authored-by: Wellington Chevreuil <wellington.chevreuil@gmail.com>
Co-authored-by: Sean Busbey <busbey@apache.org>
  • Loading branch information
3 people committed May 31, 2019
1 parent 661661d commit 343608497ab3fb3f0bc4d836445b3073a8b62daf
Showing 8 changed files with 326 additions and 56 deletions.
@@ -35,6 +35,7 @@
<properties>
<fs.hboss.sync.impl>org.apache.hadoop.hbase.oss.sync.ZKTreeLockManager</fs.hboss.sync.impl>
<aws-java-sdk.version>1.11.525</aws-java-sdk.version>
<shading.prefix>org.apache.hadoop.hbase.oss.thirdparty</shading.prefix>
</properties>

<profiles>
@@ -70,56 +71,206 @@
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>aggregate-into-a-jar-with-relocated-third-parties</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<!-- XXX If you change the set of dependencies, you should uncomment this so that
you can ensure we don't gain additional transitive dependencies that need to
be relocated. It can't be true when we build or the shade plugin will drop
all of our direct dependencies at provided and test scope. :/
-->
<!--
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
-->
<!-- XXX If you change what gets included, please review the generated
LICENSE/NOTICE files to make sure they're accurate
-->
<artifactSet>
<includes>
<include>com.google.*:*:jar:*</include>
<include>org.apache.commons:commons-lang3:jar:*</include>
<include>org.apache.curator:curator-*:jar:*</include>
<include>org.apache.yetus:audience-annotations:jar:*</include>
<include>org.apache.zookeeper:zookeeper:jar:*</include>
<!-- transitives -->
<include>io.netty:netty</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>${shading.prefix}.com.google</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>${shading.prefix}.org.apache.commons</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.curator</pattern>
<shadedPattern>${shading.prefix}.org.apache.curator</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.jute</pattern>
<shadedPattern>${shading.prefix}.org.apache.jute</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.yetus</pattern>
<shadedPattern>${shading.prefix}.org.apache.yetus</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.zookeeper</pattern>
<shadedPattern>${shading.prefix}.org.apache.zookeeper</shadedPattern>
</relocation>
<relocation>
<pattern>org.codehaus</pattern>
<shadedPattern>${shading.prefix}.org.codehaus</shadedPattern>
</relocation>
<!-- netty family -->
<relocation>
<pattern>org.jboss.netty</pattern>
<shadedPattern>${shading.prefix}.org.jboss.netty</shadedPattern>
</relocation>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>${shading.prefix}.io.netty</shadedPattern>
</relocation>
</relocations>
<transformers>
<!-- Where notices exist, just concat them -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
<addHeader>false</addHeader>
<projectName>${project.name}</projectName>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<!-- We track needed LICENSE details manually -->
<exclude>LICENSE.txt</exclude>
<exclude>META-INF/LICENSE.txt</exclude>
<exclude>META-INF/license/LICENSE*</exclude>
</excludes>
</filter>
<filter>
<!-- we manually contruct the needed NOTICE details for netty -->
<artifact>io.netty:netty</artifact>
<excludes>
<exclude>META-INF/NOTICE.txt</exclude>
</excludes>
</filter>
</filters>

</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-annotations</artifactId>
<version>${hadoop.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${hadoop.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-common</artifactId>
<version>${hbase.version}</version>
<scope>provided</scope>
</dependency>
<!-- the dependency plugin's dependency:tree output defaults to only showing transitive
dependencies coming off of the first direct dependency to need it, even when the
scope changes because another direct depenendcy has a wider scope. to make the output
easier to read, list provided and test dependencies after compile scope dependencies.
for example, we need netty at compile scope due to our zookeeper dependency. it's also
a transitive dependency of our hadoop dependency that's listed as provided.
(the verbose mode of dependency tree will show transitive dependencies multiple times
when needed by multiple direct dependencies, but it uses a different code path than
normal resolution)
-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.hbase.thirdparty</groupId>
<artifactId>hbase-shaded-miscellaneous</artifactId>
<version>${hbase-thirdparty.version}</version>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<exclusions>
<exclusion>
<!-- Banned import in HBase -->
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<!-- this should have been marked optional by guava because
the annotation are retention CLASS -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.yetus</groupId>
<artifactId>audience-annotations</artifactId>
<version>${audience-annotations.version}</version>
<scope>compile</scope>
</dependency>
<!-- For ZooKeeper implementation -->
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
<exclusions>
<exclusion>
<!-- jline is optional and we're not providing a cli -->
<groupId>jline</groupId>
<artifactId>jline</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>${curator.version}</version>
</dependency>

<!-- Provided dependencies we expect to be around at runtime. i.e. Hadoop and HBase -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${hadoop.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<!-- Banned import in HBase -->
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-common</artifactId>
<version>${hbase.version}</version>
<scope>provided</scope>
</dependency>

<!-- Test dependencies -->
@@ -175,6 +326,18 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>

<!-- For testing against S3 -->
<dependency>
@@ -196,12 +359,6 @@
<scope>test</scope>
</dependency>

<!-- For ZooKeeper implementation -->
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-zookeeper</artifactId>
@@ -215,21 +372,6 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>${curator.version}</version>
</dependency>

</dependencies>

@@ -0,0 +1,72 @@
----
This work bundles additional works available under a different license.

Parts of the Netty Project are licensed under:

This product contains the following works licensed under the following Public Domain dedication:

* extensions to Java Collections Framework which has been derived from the works by JSR-166 EG,
Doug Lea, and Jason T. Greene
* modified version of Robert Harder's Public Domain Base64 Encoder and Decoder.

The person or persons who have associated work with this document (the
"Dedicator" or "Certifier") hereby either (a) certifies that, to the best of
his knowledge, the work of authorship identified is in the public domain of
the country from which the work is published, or (b) hereby dedicates whatever
copyright the dedicators holds in the work of authorship identified below (the
"Work") to the public domain. A certifier, moreover, dedicates any copyright
interest he may have in the associated work, and for these purposes, is
described as a "dedicator" below.

A certifier has taken reasonable steps to verify the copyright status of this
work. Certifier recognizes that his good faith efforts may not shield him from
liability if in fact the work certified is not in the public domain.

Dedicator makes this dedication for the benefit of the public at large and to
the detriment of the Dedicator's heirs and successors. Dedicator intends this
dedication to be an overt act of relinquishment in perpetuity of all present
and future rights under copyright law, whether vested or contingent, in the
Work. Dedicator understands that such relinquishment of all rights includes
the relinquishment of all rights to enforce (by lawsuit or otherwise) those
copyrights in the Work.

Dedicator recognizes that, once placed in the public domain, the Work may be
freely reproduced, distributed, transmitted, used, modified, built upon, or
otherwise exploited by anyone for any purpose, commercial or non-commercial,
and in any way, including by methods that have not yet been invented or
conceived.

This product contains the following works licensed under the BSD 3-Clause license:

* modified version of 'JZlib' Copyright (c) 2000,2001,2002,2003,2004 ymnk, JCraft,Inc. All rights
reserved.
* modified version of 'Webbit' Copyright (c) 2011, Joe Walnes, Aslak Hellesøy and contributors
All rights reserved.

Copyright (c) <YEAR>, <OWNER>
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 comments on commit 3436084

Please sign in to comment.