SENTRY-2079: Sentry HA leader monitor does not work due to a mix of curator versions in the classpath (Sergio Pena, reviewed by kalyan kumar kalvagadda, Na Li)
Project: http://git-wip-us.apache.org/repos/asf/sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/169172be Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/169172be Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/169172be Branch: refs/heads/branch-2.0 Commit: 169172be8c3a4d94ee4c5bdc5f1e118575db9fee Parents: 8527336 Author: Sergio Pena <[email protected]> Authored: Fri Dec 1 09:46:09 2017 -0600 Committer: Sergio Pena <[email protected]> Committed: Fri Dec 1 09:47:52 2017 -0600 ---------------------------------------------------------------------- pom.xml | 39 +++++++------------------ sentry-binding/sentry-binding-solr/pom.xml | 6 ++++ sentry-provider/sentry-provider-db/pom.xml | 37 +++++++++++++++++++++++ sentry-tests/sentry-tests-solr/pom.xml | 1 + 4 files changed, 54 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sentry/blob/169172be/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index f342e65..eec185b 100644 --- a/pom.xml +++ b/pom.xml @@ -85,6 +85,7 @@ limitations under the License. <maven.antrun.plugin.version>1.7</maven.antrun.plugin.version> <maven.eclipse.plugin.version>2.9</maven.eclipse.plugin.version> <maven.enforcer.plugin.version>1.3.1</maven.enforcer.plugin.version> + <maven.shade.plugin.version>2.4.3</maven.shade.plugin.version> <metrics.version>3.0.2</metrics.version> <mockito.version>1.8.5</mockito.version> <objenesis.version>1.2</objenesis.version> @@ -446,6 +447,10 @@ limitations under the License. <groupId>org.eclipse.jetty.aggregate</groupId> <artifactId>jetty-all</artifactId> </exclusion> + <exclusion> + <groupId>org.apache.curator</groupId> + <artifactId>curator-client</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -631,6 +636,11 @@ limitations under the License. <version>${curator.version}</version> </dependency> <dependency> + <groupId>org.apache.curator</groupId> + <artifactId>curator-client</artifactId> + <version>${curator.version}</version> + </dependency> + <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> <version>${zookeeper.version}</version> @@ -818,35 +828,6 @@ limitations under the License. </execution> </executions> </plugin> - -<!--- - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>2.1</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <artifactSet> - <includes> - <include>org.apache.thrift:libthrift</include> - </includes> - </artifactSet> - <relocations> - <relocation> - <pattern>org.apache.thrift</pattern> - <shadedPattern>sentry.org.apache.thrift</shadedPattern> - </relocation> - </relocations> - </configuration> - </execution> - </executions> - </plugin> ---> </plugins> <pluginManagement> http://git-wip-us.apache.org/repos/asf/sentry/blob/169172be/sentry-binding/sentry-binding-solr/pom.xml ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-solr/pom.xml b/sentry-binding/sentry-binding-solr/pom.xml index 0db76bb..8a3fd1d 100644 --- a/sentry-binding/sentry-binding-solr/pom.xml +++ b/sentry-binding/sentry-binding-solr/pom.xml @@ -33,6 +33,12 @@ limitations under the License. <groupId>org.apache.solr</groupId> <artifactId>solr-core</artifactId> <version>${solr.version}</version> + <exclusions> + <exclusion> + <groupId>org.apache.curator</groupId> + <artifactId>curator-client</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>junit</groupId> http://git-wip-us.apache.org/repos/asf/sentry/blob/169172be/sentry-provider/sentry-provider-db/pom.xml ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/pom.xml b/sentry-provider/sentry-provider-db/pom.xml index d4fd9bd..679868a 100644 --- a/sentry-provider/sentry-provider-db/pom.xml +++ b/sentry-provider/sentry-provider-db/pom.xml @@ -226,6 +226,10 @@ limitations under the License. <artifactId>curator-test</artifactId> </dependency> <dependency> + <groupId>org.apache.curator</groupId> + <artifactId>curator-client</artifactId> + </dependency> + <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> </dependency> @@ -357,6 +361,39 @@ limitations under the License. <reuseForks>false</reuseForks> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>${maven.shade.plugin.version}</version> + <executions> + <execution> + <id>curator-shade</id> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <artifactSet> + <includes> + <!-- This is needed to support projects running on different versions of curator --> + <include>org.apache.curator:curator-recipes</include> + <include>org.apache.curator:curator-x-discovery</include> + <include>org.apache.curator:curator-framework</include> + <include>org.apache.curator:curator-client</include> + </includes> + </artifactSet> + <relocations> + <!-- Adding prefix to the package to make it unique --> + <relocation> + <pattern>org.apache.curator</pattern> + <shadedPattern>sentry.org.apache.curator</shadedPattern> + </relocation> + </relocations> + <shadedArtifactAttached>false</shadedArtifactAttached> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> <profiles> http://git-wip-us.apache.org/repos/asf/sentry/blob/169172be/sentry-tests/sentry-tests-solr/pom.xml ---------------------------------------------------------------------- diff --git a/sentry-tests/sentry-tests-solr/pom.xml b/sentry-tests/sentry-tests-solr/pom.xml index c7125bd..01f5c6c 100644 --- a/sentry-tests/sentry-tests-solr/pom.xml +++ b/sentry-tests/sentry-tests-solr/pom.xml @@ -148,6 +148,7 @@ limitations under the License. <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-test-framework</artifactId> + <scope>test</scope> </dependency> <dependency> <groupId>org.apache.solr</groupId>
