This is an automated email from the ASF dual-hosted git repository. rxl pushed a commit to branch branch-2.6 in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit f0363e3847c1affe4f1ff92b40336c03a74cbf69 Author: ran <gaoran...@126.com> AuthorDate: Mon Jul 6 07:24:13 2020 +0800 shaded jclouds to avoid gson conflict Signed-off-by: xiaolong.ran <r...@apache.org> --- jclouds-shaded/pom.xml | 140 +++++++++++++++++++++ pom.xml | 13 +- tiered-storage/jcloud/pom.xml | 36 ++++-- .../impl/BlobStoreManagedLedgerOffloader.java | 6 +- .../impl/BlobStoreManagedLedgerOffloaderTest.java | 2 +- tiered-storage/pom.xml | 4 + 6 files changed, 178 insertions(+), 23 deletions(-) diff --git a/jclouds-shaded/pom.xml b/jclouds-shaded/pom.xml new file mode 100644 index 0000000..efd8ff9 --- /dev/null +++ b/jclouds-shaded/pom.xml @@ -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> diff --git a/pom.xml b/pom.xml index bac783a..822dd65 100644 --- a/pom.xml +++ b/pom.xml @@ -133,6 +133,7 @@ flexible messaging model and an intuitive client API.</description> <module>docker</module> <module>tests</module> <module>pulsar-metadata</module> + <module>jclouds-shaded</module> </modules> <issueManagement> @@ -1005,18 +1006,6 @@ flexible messaging model and an intuitive client API.</description> <version>${commons.collections.version}</version> </dependency> - <dependency> - <groupId>org.apache.jclouds</groupId> - <artifactId>jclouds-allblobstore</artifactId> - <version>${jclouds.version}</version> - </dependency> - - <dependency> - <groupId>org.apache.jclouds</groupId> - <artifactId>jclouds-blobstore</artifactId> - <version>${jclouds.version}</version> - </dependency> - <!-- test dependencies --> <dependency> <groupId>com.lmax</groupId> diff --git a/tiered-storage/jcloud/pom.xml b/tiered-storage/jcloud/pom.xml index 9e68965..051e16e 100644 --- a/tiered-storage/jcloud/pom.xml +++ b/tiered-storage/jcloud/pom.xml @@ -40,13 +40,35 @@ </dependency> <dependency> - <groupId>org.apache.jclouds</groupId> - <artifactId>jclouds-allblobstore</artifactId> - </dependency> - - <dependency> - <groupId>org.apache.jclouds</groupId> - <artifactId>jclouds-blobstore</artifactId> + <groupId>org.apache.pulsar</groupId> + <artifactId>jclouds-shaded</artifactId> + <version>${pulsar.jclouds.shaded.version}</version> + <exclusions> + <exclusion> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + </exclusion> + <exclusion> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.jclouds</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.jclouds.api</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.jclouds.common</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.jclouds.provider</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> diff --git a/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java b/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java index 6bb5b21..76d039a 100644 --- a/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java +++ b/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java @@ -23,7 +23,6 @@ import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.auth.AWSSessionCredentials; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Strings; -import com.google.common.base.Supplier; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; @@ -50,6 +49,7 @@ import org.apache.bookkeeper.mledger.offload.jcloud.OffloadIndexBlock; import org.apache.bookkeeper.mledger.offload.jcloud.OffloadIndexBlockBuilder; import org.apache.commons.lang3.tuple.Pair; import org.apache.pulsar.common.policies.data.OffloadPolicies; +import org.apache.pulsar.jcloud.shade.com.google.common.base.Supplier; import org.jclouds.Constants; import org.jclouds.ContextBuilder; import org.jclouds.aws.domain.SessionCredentials; @@ -69,10 +69,10 @@ import org.jclouds.googlecloud.GoogleCredentialsFromJson; import org.jclouds.googlecloudstorage.GoogleCloudStorageProviderMetadata; import org.jclouds.io.Payload; import org.jclouds.io.Payloads; -import org.jclouds.osgi.ProviderRegistry; -import org.jclouds.s3.reference.S3Constants; import org.jclouds.osgi.ApiRegistry; +import org.jclouds.osgi.ProviderRegistry; import org.jclouds.s3.S3ApiMetadata; +import org.jclouds.s3.reference.S3Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/tiered-storage/jcloud/src/test/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloaderTest.java b/tiered-storage/jcloud/src/test/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloaderTest.java index ed46a01..8aa977a 100644 --- a/tiered-storage/jcloud/src/test/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloaderTest.java +++ b/tiered-storage/jcloud/src/test/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloaderTest.java @@ -28,7 +28,6 @@ import static org.mockito.Mockito.mock; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.auth.AWSSessionCredentials; -import com.google.common.base.Supplier; import com.google.common.util.concurrent.MoreExecutors; import java.io.File; import java.io.IOException; @@ -56,6 +55,7 @@ import org.apache.bookkeeper.mledger.offload.jcloud.BlobStoreTestBase; import org.apache.bookkeeper.mledger.offload.jcloud.CredentialsUtil; import org.apache.bookkeeper.util.ZkUtils; import org.apache.pulsar.common.policies.data.OffloadPolicies; +import org.apache.pulsar.jcloud.shade.com.google.common.base.Supplier; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.MockZooKeeper; import org.apache.zookeeper.data.ACL; diff --git a/tiered-storage/pom.xml b/tiered-storage/pom.xml index 70a69db..ba0c3fd 100644 --- a/tiered-storage/pom.xml +++ b/tiered-storage/pom.xml @@ -32,6 +32,10 @@ <artifactId>tiered-storage-parent</artifactId> <name>Apache Pulsar :: Tiered Storage :: Parent</name> + <properties> + <pulsar.jclouds.shaded.version>${project.version}</pulsar.jclouds.shaded.version> + </properties> + <modules> <module>jcloud</module> <module>file-system</module>