1 <?xml version="1.0" encoding="UTF-8"?>
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software
8 distributed under the License is distributed on an "AS IS" BASIS,
9 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 See the License for the specific language governing permissions and
11 limitations under the License. See accompanying LICENSE file.
13 <project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
14 xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
15 <modelVersion>4.0.0</modelVersion>
17 <artifactId>hbase</artifactId>
18 <groupId>org.apache.hbase</groupId>
19 <version>3.0.0-alpha-3-SNAPSHOT</version>
20 <relativePath>../..</relativePath>
22 <artifactId>hbase-shaded-with-hadoop-check-invariants</artifactId>
23 <packaging>pom</packaging>
26 Enforces our invariants for our shaded artifacts. e.g. shaded clients have
27 a specific set of transitive dependencies and shaded clients only contain
28 classes that are in particular packages. Does the enforcement through
29 the maven-enforcer-plugin and integration test.
31 <name>Apache HBase Shaded Packaging Invariants (with Hadoop bundled)</name>
37 <!-- This should only be client facing artifacts that bundle
38 Apache Hadoop related artifacts.
41 <groupId>org.apache.hbase</groupId>
42 <artifactId>hbase-shaded-client</artifactId>
44 <!-- parent pom defines these for children. :( :( :( -->
46 <groupId>com.github.stephenc.findbugs</groupId>
47 <artifactId>findbugs-annotations</artifactId>
48 <scope>provided</scope>
51 <groupId>org.apache.logging.log4j</groupId>
52 <artifactId>log4j-api</artifactId>
53 <scope>provided</scope>
56 <groupId>org.apache.logging.log4j</groupId>
57 <artifactId>log4j-core</artifactId>
58 <scope>provided</scope>
61 <groupId>org.apache.logging.log4j</groupId>
62 <artifactId>log4j-slf4j-impl</artifactId>
63 <scope>provided</scope>
65 <!-- Test dependencies -->
67 <groupId>junit</groupId>
68 <artifactId>junit</artifactId>
69 <scope>provided</scope>
72 <groupId>org.mockito</groupId>
73 <artifactId>mockito-core</artifactId>
74 <scope>provided</scope>
80 <groupId>org.apache.maven.plugins</groupId>
81 <artifactId>maven-site-plugin</artifactId>
87 <groupId>org.apache.maven.plugins</groupId>
88 <artifactId>maven-enforcer-plugin</artifactId>
91 <id>enforce-banned-dependencies</id>
98 <banTransitiveDependencies>
101 Our client-facing artifacts are not supposed to have additional dependencies
102 and one or more of them do. The output from the enforcer plugin should give
107 <!-- We leave logging stuff alone -->
108 <exclude>org.slf4j:*</exclude>
109 <exclude>log4j:*</exclude>
110 <exclude>commons-logging:*</exclude>
111 <!-- annotations that never change -->
112 <exclude>com.google.code.findbugs:*</exclude>
113 <exclude>com.github.stephenc.findbugs:*</exclude>
114 <exclude>com.github.spotbugs:*</exclude>
115 <!-- We leave HTrace as an unshaded dependnecy on purpose so that tracing within a JVM will work -->
116 <exclude>org.apache.htrace:*</exclude>
117 <!-- NB we don't exclude Hadoop from this check here, because the assumption is any needed classes
118 are contained in our artifacts.
121 </banTransitiveDependencies>
122 <banDuplicateClasses>
123 <findAllDuplicates>true</findAllDuplicates>
124 </banDuplicateClasses>
131 <groupId>org.apache.maven.plugins</groupId>
132 <artifactId>maven-resources-plugin</artifactId>
135 <id>test-resources</id>
136 <phase>pre-integration-test</phase>
138 <goal>testResources</goal>
144 <!-- create a maven pom property that has all of our dependencies.
145 below in the integration-test phase we'll pass this list
146 of paths to our jar checker script.
148 <groupId>org.apache.maven.plugins</groupId>
149 <artifactId>maven-dependency-plugin</artifactId>
152 <id>put-client-artifacts-in-a-property</id>
153 <phase>pre-integration-test</phase>
155 <goal>build-classpath</goal>
158 <excludeScope>provided</excludeScope>
159 <excludeTransitive>true</excludeTransitive>
160 <outputProperty>hbase-client-artifacts</outputProperty>
166 <groupId>org.codehaus.mojo</groupId>
167 <artifactId>exec-maven-plugin</artifactId>
168 <version>1.6.0</version>
170 <!-- It's easier to have two copies of our validation
171 script than to copy it via remote-resources-plugin, but
172 we need to make sure they stay the same.
175 <id>make-sure-validation-files-are-in-sync</id>
176 <phase>validate</phase>
181 <executable>diff</executable>
182 <requiresOnline>false</requiresOnline>
184 <argument>../hbase-shaded-with-hadoop-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh</argument>
185 <argument>../hbase-shaded-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh</argument>
190 Check that we actually relocated everything we included.
191 It's critical that we don't ship third party dependencies that haven't
192 been relocated under our package space, since this will lead to
193 difficult to debug classpath errors for downstream. Unfortunately, that
194 means inspecting all the jars.
197 <id>check-jar-contents-for-stuff-with-hadoop</id>
198 <phase>integration-test</phase>
203 <executable>${shell-executable}</executable>
204 <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
205 <requiresOnline>false</requiresOnline>
207 <argument>ensure-jars-have-correct-contents.sh</argument>
208 <argument>--allow-hadoop</argument>
209 <argument>${hbase-client-artifacts}</argument>