sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From linaataus...@apache.org
Subject sentry git commit: SENTRY-2311: Intellij is broken by shaded jars (Steve Moist, reviewed by Na Li)
Date Fri, 07 Sep 2018 17:26:50 GMT
Repository: sentry
Updated Branches:
  refs/heads/master 6b078d872 -> d61228503


SENTRY-2311: Intellij is broken by shaded jars (Steve Moist, reviewed by Na Li)


Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/d6122850
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/d6122850
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/d6122850

Branch: refs/heads/master
Commit: d6122850313c731de76a0d682bece2920a2aed2a
Parents: 6b078d8
Author: lina.li <lina.li@cloudera.com>
Authored: Fri Sep 7 12:26:04 2018 -0500
Committer: lina.li <lina.li@cloudera.com>
Committed: Fri Sep 7 12:26:04 2018 -0500

----------------------------------------------------------------------
 pom.xml                                         |   1 +
 sentry-dist/pom.xml                             |  26 +++++
 sentry-dist/src/main/assembly/bin.xml           |  12 +++
 .../apache/sentry/hdfs/PathDeltaRetriever.java  |   2 +-
 .../apache/sentry/hdfs/PathImageRetriever.java  |   2 +-
 .../apache/sentry/hdfs/PermDeltaRetriever.java  |   2 +-
 .../apache/sentry/hdfs/PermImageRetriever.java  |   2 +-
 .../sentry/hdfs/SentryHDFSServiceProcessor.java |   2 +-
 .../sentry/hdfs/SentryHdfsMetricsUtil.java      |   8 +-
 sentry-provider/sentry-provider-db/pom.xml      |  24 -----
 sentry-service/sentry-service-server/pom.xml    |   9 --
 sentry-thirdparty/pom.xml                       |  37 +++++++
 sentry-thirdparty/sentry-shaded/pom.xml         | 108 +++++++++++++++++++
 13 files changed, 193 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d5f9dc6..e31c194 100644
--- a/pom.xml
+++ b/pom.xml
@@ -951,6 +951,7 @@ limitations under the License.
   </dependencyManagement>
 
   <modules>
+    <module>sentry-thirdparty</module>
     <module>sentry-core</module>
     <module>sentry-binding</module>
     <module>sentry-provider</module>

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-dist/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-dist/pom.xml b/sentry-dist/pom.xml
index 6291e4f..b892536 100644
--- a/sentry-dist/pom.xml
+++ b/sentry-dist/pom.xml
@@ -101,6 +101,32 @@ limitations under the License.
     <dependency>
       <groupId>org.apache.sentry</groupId>
       <artifactId>sentry-binding-hive</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.sentry</groupId>
+          <artifactId>sentry-provider-db</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sentry</groupId>
+      <artifactId>sentry-service-client</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+    <groupId>org.apache.sentry</groupId>
+    <artifactId>sentry-service-api</artifactId>
+    <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sentry</groupId>
+      <artifactId>sentry-policy-engine</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sentry</groupId>
+      <artifactId>sentry-binding-hive-follower</artifactId>
+      <version>${project.version}</version>
     </dependency>
   </dependencies>
 

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-dist/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/sentry-dist/src/main/assembly/bin.xml b/sentry-dist/src/main/assembly/bin.xml
index fc012c6..986530c 100644
--- a/sentry-dist/src/main/assembly/bin.xml
+++ b/sentry-dist/src/main/assembly/bin.xml
@@ -46,6 +46,9 @@
         <exclude>org.apache.derby:derby</exclude>
         <!-- SENTRY-2283 multiple versions of metrics cause failures on startup -->
         <exclude>io.dropwizard.metrics:*</exclude>
+        <!-- exclude the original jars, we'll add them in later with the shaded versions.
-->
+        <exclude>org.apache.sentry:sentry-service-server</exclude>
+        <exclude>org.apache.sentry:sentry-hdfs-service</exclude>
       </excludes>
     </dependencySet>
 <!--
@@ -104,6 +107,7 @@
         <exclude>sentry-tests/**</exclude>
         <exclude>sentry-hdfs/**</exclude>
         <exclude>sentry-solr/**</exclude>
+        <exclude>sentry-service/**</exclude>
       </excludes>
 
       <includes>
@@ -118,6 +122,14 @@
       <outputDirectory>/</outputDirectory>
     </fileSet>
     <fileSet>
+      <directory>${project.parent.basedir}/sentry-thirdparty/sentry-shaded/target/</directory>
+      <includes>
+        <include>sentry-service-server-${project.version}.jar</include>
+        <include>sentry-hdfs-service-${project.version}.jar</include>
+      </includes>
+      <outputDirectory>lib/</outputDirectory>
+    </fileSet>
+    <fileSet>
       <directory>${project.parent.basedir}/sentry-hdfs/sentry-hdfs-dist/target</directory>
       <includes>
         <include>sentry-hdfs-*.jar</include>

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathDeltaRetriever.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathDeltaRetriever.java
b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathDeltaRetriever.java
index 0d39300..81c614a 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathDeltaRetriever.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathDeltaRetriever.java
@@ -17,7 +17,7 @@
  */
 package org.apache.sentry.hdfs;
 
-import sentry.com.codahale.metrics.Timer.Context;
+import com.codahale.metrics.Timer.Context;
 import org.apache.sentry.provider.db.service.model.MSentryPathChange;
 import org.apache.sentry.provider.db.service.persistent.SentryStoreInterface;
 

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathImageRetriever.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathImageRetriever.java
b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathImageRetriever.java
index 2b16181..3532ef3 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathImageRetriever.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PathImageRetriever.java
@@ -17,7 +17,7 @@
  */
 package org.apache.sentry.hdfs;
 
-import sentry.com.codahale.metrics.Timer;
+import com.codahale.metrics.Timer;
 import org.apache.sentry.provider.db.service.persistent.SentryStoreInterface;
 
 import javax.annotation.concurrent.ThreadSafe;

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermDeltaRetriever.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermDeltaRetriever.java
b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermDeltaRetriever.java
index b9405cc..8d6713a 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermDeltaRetriever.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermDeltaRetriever.java
@@ -17,7 +17,7 @@
  */
 package org.apache.sentry.hdfs;
 
-import sentry.com.codahale.metrics.Timer.Context;
+import com.codahale.metrics.Timer.Context;
 import org.apache.sentry.hdfs.service.thrift.TPrivilegeChanges;
 import org.apache.sentry.provider.db.service.model.MSentryPermChange;
 import org.apache.sentry.provider.db.service.persistent.SentryStoreInterface;

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermImageRetriever.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermImageRetriever.java
b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermImageRetriever.java
index f3a2d50..4434341 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermImageRetriever.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/PermImageRetriever.java
@@ -17,7 +17,7 @@
  */
 package org.apache.sentry.hdfs;
 
-import sentry.com.codahale.metrics.Timer.Context;
+import com.codahale.metrics.Timer.Context;
 import org.apache.sentry.hdfs.service.thrift.TPrivilegePrincipal;
 import org.apache.sentry.hdfs.service.thrift.TPermissionsUpdate;
 import org.apache.sentry.hdfs.service.thrift.TPrivilegeChanges;

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHDFSServiceProcessor.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHDFSServiceProcessor.java
b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHDFSServiceProcessor.java
index 5e2d5c5..0cd405b 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHDFSServiceProcessor.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHDFSServiceProcessor.java
@@ -23,7 +23,7 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
-import sentry.com.codahale.metrics.Timer.Context;
+import com.codahale.metrics.Timer.Context;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.sentry.hdfs.service.thrift.SentryHDFSService;
 import org.apache.sentry.hdfs.service.thrift.TAuthzUpdateRequest;

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHdfsMetricsUtil.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHdfsMetricsUtil.java
b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHdfsMetricsUtil.java
index f299825..3bf300b 100644
--- a/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHdfsMetricsUtil.java
+++ b/sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/SentryHdfsMetricsUtil.java
@@ -18,10 +18,10 @@
 
 package org.apache.sentry.hdfs;
 
-import sentry.com.codahale.metrics.Counter;
-import sentry.com.codahale.metrics.Histogram;
-import sentry.com.codahale.metrics.MetricRegistry;
-import sentry.com.codahale.metrics.Timer;
+import com.codahale.metrics.Counter;
+import com.codahale.metrics.Histogram;
+import com.codahale.metrics.MetricRegistry;
+import com.codahale.metrics.Timer;
 import org.apache.sentry.api.service.thrift.SentryMetrics;
 
 /**

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/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 9f89ca3..ab586f7 100644
--- a/sentry-provider/sentry-provider-db/pom.xml
+++ b/sentry-provider/sentry-provider-db/pom.xml
@@ -198,21 +198,6 @@ limitations under the License.
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>io.dropwizard.metrics</groupId>
-      <artifactId>metrics-core</artifactId>
-      <version>${metrics.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>io.dropwizard.metrics</groupId>
-      <artifactId>metrics-servlets</artifactId>
-      <version>${metrics.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>io.dropwizard.metrics</groupId>
-      <artifactId>metrics-jvm</artifactId>
-      <version>${metrics.version}</version>
-    </dependency>
-    <dependency>
       <groupId>org.eclipse.jetty</groupId>
       <artifactId>jetty-server</artifactId>
     </dependency>
@@ -324,7 +309,6 @@ limitations under the License.
                   <include>org.apache.curator:curator-x-discovery</include>
                   <include>org.apache.curator:curator-framework</include>
                   <include>org.apache.curator:curator-client</include>
-                  <include>io.dropwizard.metrics:*</include>
                 </includes>
               </artifactSet>
               <relocations>
@@ -333,14 +317,6 @@ limitations under the License.
                   <pattern>org.apache.curator</pattern>
                   <shadedPattern>sentry.org.apache.curator</shadedPattern>
                 </relocation>
-                <relocation>
-                  <pattern>io.dropwizard.metrics</pattern>
-                  <shadedPattern>sentry.io.dropwizard.metrics</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>com.codahale.metrics</pattern>
-                  <shadedPattern>sentry.com.codahale.metrics</shadedPattern>
-                </relocation>
               </relocations>
               <shadeSourcesContent>true</shadeSourcesContent>
               <createSourcesJar>true</createSourcesJar>

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-service/sentry-service-server/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-service/sentry-service-server/pom.xml b/sentry-service/sentry-service-server/pom.xml
index 8315358..4919183 100644
--- a/sentry-service/sentry-service-server/pom.xml
+++ b/sentry-service/sentry-service-server/pom.xml
@@ -289,7 +289,6 @@ limitations under the License.
                                     <include>org.apache.curator:curator-x-discovery</include>
                                     <include>org.apache.curator:curator-framework</include>
                                     <include>org.apache.curator:curator-client</include>
-                                    <include>io.dropwizard.metrics:*</include>
                                 </includes>
                             </artifactSet>
                             <relocations>
@@ -298,14 +297,6 @@ limitations under the License.
                                     <pattern>org.apache.curator</pattern>
                                     <shadedPattern>sentry.org.apache.curator</shadedPattern>
                                 </relocation>
-                                <relocation>
-                                    <pattern>io.dropwizard.metrics</pattern>
-                                    <shadedPattern>sentry.io.dropwizard.metrics</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>com.codahale.metrics</pattern>
-                                    <shadedPattern>sentry.com.codahale.metrics</shadedPattern>
-                                </relocation>
                             </relocations>
                             <shadedArtifactAttached>false</shadedArtifactAttached>
                             <createSourcesJar>true</createSourcesJar>

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-thirdparty/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-thirdparty/pom.xml b/sentry-thirdparty/pom.xml
new file mode 100644
index 0000000..bfb5fa9
--- /dev/null
+++ b/sentry-thirdparty/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~
+  ~ 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 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/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>sentry</artifactId>
+    <groupId>org.apache.sentry</groupId>
+    <version>2.1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>pom</packaging>
+
+  <artifactId>sentry-thirdparty</artifactId>
+  <modules>
+    <module>sentry-shaded</module>
+  </modules>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sentry/blob/d6122850/sentry-thirdparty/sentry-shaded/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-thirdparty/sentry-shaded/pom.xml b/sentry-thirdparty/sentry-shaded/pom.xml
new file mode 100644
index 0000000..beb89b0
--- /dev/null
+++ b/sentry-thirdparty/sentry-shaded/pom.xml
@@ -0,0 +1,108 @@
+<?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 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/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>sentry-thirdparty</artifactId>
+    <groupId>org.apache.sentry</groupId>
+    <version>2.1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.sentry</groupId>
+  <artifactId>sentry-shaded</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.sentry</groupId>
+      <artifactId>sentry-service-server</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sentry</groupId>
+      <artifactId>sentry-hdfs-service</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+  <profiles>
+    <profile>
+      <id>dist</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-shade-plugin</artifactId>
+            <version>${maven.shade.plugin.version}</version>
+            <executions>
+              <execution>
+                <id>sentry-service-server-shader</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>shade</goal>
+                </goals>
+                <configuration>
+                  <artifactSet>
+                    <includes>
+                      <include>org.apache.sentry:sentry-service-server:*</include>
+                      <include>io.dropwizard.metrics:*</include>
+                    </includes>
+                  </artifactSet>
+                  <relocations>
+                    <relocation>
+                      <pattern>com.codahale.metrics</pattern>
+                      <shadedPattern>sentry.com.codahale.metrics</shadedPattern>
+                    </relocation>
+                  </relocations>
+                  <finalName>sentry-service-server-${project.version}</finalName>
+                  <shadedArtifactAttached>false</shadedArtifactAttached>
+                  <createSourcesJar>true</createSourcesJar>
+                </configuration>
+              </execution>
+              <execution>
+                <id>sentry-hdfs-service-shader</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>shade</goal>
+                </goals>
+                <configuration>
+                  <artifactSet>
+                    <includes>
+                      <include>org.apache.sentry:sentry-hdfs-service:*</include>
+                      <include>io.dropwizard.metrics:*</include>
+                    </includes>
+                  </artifactSet>
+                  <relocations>
+                    <relocation>
+                      <pattern>com.codahale.metrics</pattern>
+                      <shadedPattern>sentry.com.codahale.metrics</shadedPattern>
+                    </relocation>
+                  </relocations>
+                  <finalName>sentry-hdfs-service-${project.version}</finalName>
+                  <shadedArtifactAttached>false</shadedArtifactAttached>
+                  <createSourcesJar>true</createSourcesJar>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+</project>
\ No newline at end of file


Mime
View raw message