bbeaudreault commented on a change in pull request #4304:
URL: https://github.com/apache/hbase/pull/4304#discussion_r839800459



##########
File path: hbase-shaded/hbase-shaded-mapreduce-provided-dependencies/pom.xml
##########
@@ -0,0 +1,313 @@
+<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";>
+    <!--
+      /**
+       * 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.
+       */
+      -->
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <artifactId>hbase-shaded</artifactId>
+    <groupId>org.apache.hbase</groupId>
+    <version>2.6.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+
+  <artifactId>hbase-shaded-mapreduce-provided-dependencies</artifactId>
+  <name>Apache HBase - Shaded - MapReduce - Provided Dependencies 
Wrapper</name>
+  <description>Wrapper pom for including provided scope dependencies in 
hbase-shaded-mapreduce.</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-shaded-client-byo-hadoop</artifactId>
+      <!--
+      it's a bit ugly to have to exclude these, but for some reason they come 
through in
+      a reactor build, even though they are not actually exposed in the 
resulting byo artifact
+      outside a reactor build
+      -->
+      <exclusions>

Review comment:
       This is really interesting. 
   
   So, I've verified that the resulting shaded artifact for 
`hbase-shaded-client-byo-hadoop` works correctly -- it includes the right 
classes, and if you include it in a downstream project it doesn't leak any 
unshaded deps.  
   
   Additionally, if you `mvn clean install` everything, and then separately 
`mvn clean install -pl hbase-shaded-mapreduce`, the resulting artifact there 
will _also be correct.
   
   However, the default of a reactor build (`mvn clean install` at repo root) 
for some reason will see the transitive dependencies that make up 
hbase-shaded-client-byo-hadoop and try to include them all in the 
hbase-shaded-mapreduce (in addition to byo-hadoop itself). This results in 
duplicate class warnings.
   
   I don't know why the reactor build works like that, but these exclusions 
here fix it. With these exclusions in place, a reactor build of 
hbase-shaded-mapreduce appropriately excludes these deps from the shaded jar 
and no duplicate class warnings arise.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to