Skip to content
Permalink
Browse files
HBASE-23052 Provide a jdk7 compatible relocated GSON in its own modul…
…e. (#4)

Signed-off-by: Peter Somogyi <psomogyi@apache.org>
  • Loading branch information
busbey committed Sep 21, 2019
1 parent baa4f71 commit d341cf4e9e89f5ac33ec741183c7aafbdfa59b14
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 9 deletions.
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_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.
*/
ON MVN COMPILE NOT WORKING
If you wondering why 'mvn compile' does not work building HBase
(in particular, if you are doing it for the first time), instead do
'mvn package'. If you are interested in the full story, see
https://issues.apache.org/jira/browse/HBASE-6795.
-->
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.hbase.thirdparty</groupId>
<artifactId>hbase-thirdparty</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>hbase-shaded-gson</artifactId>
<name>Apache HBase Relocated (Shaded) GSON Libs</name>
<description>
Pulls down GSON, relocates it and makes a far jar.
</description>
<properties>
<!-- This GSON is also used by branch-1, so make sure we're jdk7 compatible -->
<compileSource>1.7</compileSource>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}</directory>
<includes>
<include>dependency-reduced-pom.xml</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadeSourcesContent>true</shadeSourcesContent>
<createSourcesJar>true</createSourcesJar>
<relocations>
<relocation>
<pattern>com.google.gson</pattern>
<shadedPattern>${rename.offset}.com.google.gson</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.thirdparty</pattern>
<shadedPattern>${rename.offset}.com.google.thirdparty</shadedPattern>
</relocation>
</relocations>
<artifactSet>
<excludes>
<!--Exclude protobuf itself. We get a patched version in adjacent module.
Exclude other dependencies of guava, netty, etc.
Anything added here needs to be excluded from the jar that pulls it in
also else we give an odd signal in the META-INF/DEPENDENCIES that we
produce. See below for how to exclusion of transitive dependencies.
-->
<exclude>com.google.protobuf:protobuf-java</exclude>
<exclude>com.google.code.findbugs:jsr305</exclude>
<exclude>com.google.errorprone:error_prone_annotations</exclude>
<exclude>com.google.j2objc:j2objc-annotations</exclude>
<exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
</excludes>
</artifactSet>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer">
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
<addHeader>false</addHeader>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
</dependencies>
</project>
@@ -32,7 +32,7 @@
<parent>
<groupId>org.apache.hbase.thirdparty</groupId>
<artifactId>hbase-thirdparty</artifactId>
<version>2.2.2-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>hbase-shaded-miscellaneous</artifactId>
@@ -104,6 +104,7 @@
<exclude>com.google.errorprone:error_prone_annotations</exclude>
<exclude>com.google.j2objc:j2objc-annotations</exclude>
<exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
<exclude>com.google.code.gson:gson</exclude>
</excludes>
</artifactSet>
<transformers>
@@ -120,11 +121,6 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@@ -32,7 +32,7 @@
<parent>
<groupId>org.apache.hbase.thirdparty</groupId>
<artifactId>hbase-thirdparty</artifactId>
<version>2.2.2-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>hbase-shaded-netty</artifactId>
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.hbase.thirdparty</groupId>
<artifactId>hbase-thirdparty</artifactId>
<version>2.2.2-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>hbase-shaded-protobuf</artifactId>
@@ -38,7 +38,7 @@
</parent>
<groupId>org.apache.hbase.thirdparty</groupId>
<artifactId>hbase-thirdparty</artifactId>
<version>2.2.2-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<name>Apache HBase Third-Party Libs</name>
<packaging>pom</packaging>
<description>
@@ -56,6 +56,7 @@
<modules>
<module>hbase-shaded-protobuf</module>
<module>hbase-shaded-netty</module>
<module>hbase-shaded-gson</module>
<module>hbase-shaded-miscellaneous</module>
</modules>
<scm>

0 comments on commit d341cf4

Please sign in to comment.