forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shaded jclouds to avoid gson conflict (apache#7435)
Fixes apache#7402 ### Motivation Currently, the GCS offload error is still existing. In jclouds `2.2.0` and `2.2.1`, it only shaded the package [`com.google.gson.internal`](https://github.com/apache/jclouds/blob/master/gson/gson-shaded/pom.xml#L70), and in the class [`org.jclouds.json.internal.NullFilteringTypeAdapterFactories`](https://github.com/apache/jclouds/blob/master/core/src/main/java/org/jclouds/json/internal/NullFilteringTypeAdapterFactories.java#L319) the shaded class `org.jclouds.json.gson.internal.JsonReaderInternalAccess` will be initialized by `com.google.gson.stream.JsonReader` which is in jclouds, the Pulsar include the same class `com.google.gson.stream.JsonReader` and when Pulsar broker start it will be loaded before jclouds's, so this will cause the `org.jclouds.json.gson.internal.JsonReaderInternalAccess` can't be initialized successfully, and occurs NPE. ### Modifications Shaded the jclouds to make the class `org.jclouds.json.gson.internal.JsonReaderInternalAccess` could be initialized normally.
- Loading branch information
Showing
6 changed files
with
175 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
<?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. | ||
--> | ||
<project | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | ||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.apache.pulsar</groupId> | ||
<artifactId>pulsar</artifactId> | ||
<version>2.7.0-SNAPSHOT</version> | ||
<relativePath>..</relativePath> | ||
</parent> | ||
|
||
<artifactId>jclouds-shaded</artifactId> | ||
<name>Apache Pulsar :: Jclouds shaded</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.jclouds</groupId> | ||
<artifactId>jclouds-allblobstore</artifactId> | ||
<version>${jclouds.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<!-- JClouds still is using Guava 18.0 and it won't work with newer versions --> | ||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
<version>18.0</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<createDependencyReducedPom>true</createDependencyReducedPom> | ||
<promoteTransitiveDependencies>true</promoteTransitiveDependencies> | ||
<minimizeJar>false</minimizeJar> | ||
|
||
<artifactSet> | ||
<includes> | ||
<include>com.google.guava:guava</include> | ||
<include>org.apache.jclouds:*</include> | ||
<include>org.apache.jclouds.api:*</include> | ||
<include>org.apache.jclouds.common:*</include> | ||
<include>org.apache.jclouds.provider:*</include> | ||
<include>com.google.inject.extensions:guice-assistedinject</include> | ||
<include>com.google.inject:guice</include> | ||
<include>com.google.inject.extensions:guice-multibindings</include> | ||
<include>javax.ws.rs:*</include> | ||
<include>com.jamesmurty.utils:*</include> | ||
<include>net.iharder:*</include> | ||
<include>aopalliance:*</include> | ||
<include>javax.inject:*</include> | ||
<include>javax.annotation:*</include> | ||
<include>com.google.errorprone:*</include> | ||
</includes> | ||
</artifactSet> | ||
|
||
<relocations> | ||
<relocation> | ||
<pattern>com.google.gson.internal</pattern> | ||
<shadedPattern>org.jclouds.json.gson.internal</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>com.google</pattern> | ||
<shadedPattern>org.apache.pulsar.jcloud.shade.com.google</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>javax.ws</pattern> | ||
<shadedPattern>org.apache.pulsar.jcloud.shade.javax.ws</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>com.jamesmurty.utils</pattern> | ||
<shadedPattern>org.apache.pulsar.jcloud.shade.com.jamesmurty.utils</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>aopalliance</pattern> | ||
<shadedPattern>org.apache.pulsar.jcloud.shade.aopalliance</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>net.iharder</pattern> | ||
<shadedPattern>org.apache.pulsar.jcloud.shade.net.iharder</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>javax.inject</pattern> | ||
<shadedPattern>org.apache.pulsar.jcloud.shade.javax.inject</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>javax.annotation</pattern> | ||
<shadedPattern>org.apache.pulsar.jcloud.shade.javax.annotation</shadedPattern> | ||
</relocation> | ||
<relocation> | ||
<pattern>com.google.errorprone</pattern> | ||
<shadedPattern>org.apache.pulsar.jcloud.shade.com.google.errorprone</shadedPattern> | ||
</relocation> | ||
|
||
</relocations> | ||
<transformers> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.PluginXmlResourceTransformer"/> | ||
</transformers> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters