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>2.4.1</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>
43 <version>${project.version}</version>
45 <!-- parent pom defines these for children. :( :( :( -->
47 <groupId>com.github.stephenc.findbugs</groupId>
48 <artifactId>findbugs-annotations</artifactId>
49 <scope>provided</scope>
52 <groupId>log4j</groupId>
53 <artifactId>log4j</artifactId>
54 <scope>provided</scope>
56 <!-- Test dependencies -->
58 <groupId>junit</groupId>
59 <artifactId>junit</artifactId>
60 <scope>provided</scope>
63 <groupId>org.mockito</groupId>
64 <artifactId>mockito-core</artifactId>
65 <scope>provided</scope>
71 <groupId>org.apache.maven.plugins</groupId>
72 <artifactId>maven-site-plugin</artifactId>
78 <groupId>org.apache.maven.plugins</groupId>
79 <artifactId>maven-enforcer-plugin</artifactId>
82 <id>enforce-banned-dependencies</id>
89 <banTransitiveDependencies>
92 Our client-facing artifacts are not supposed to have additional dependencies
93 and one or more of them do. The output from the enforcer plugin should give
98 <!-- We leave logging stuff alone -->
99 <exclude>org.slf4j:*</exclude>
100 <exclude>log4j:*</exclude>
101 <exclude>commons-logging:*</exclude>
102 <!-- annotations that never change -->
103 <exclude>com.google.code.findbugs:*</exclude>
104 <exclude>com.github.stephenc.findbugs:*</exclude>
105 <exclude>com.github.spotbugs:*</exclude>
106 <!-- We leave HTrace as an unshaded dependnecy on purpose so that tracing within a JVM will work -->
107 <exclude>org.apache.htrace:*</exclude>
108 <!-- NB we don't exclude Hadoop from this check here, because the assumption is any needed classes
109 are contained in our artifacts.
112 </banTransitiveDependencies>
113 <banDuplicateClasses>
114 <findAllDuplicates>true</findAllDuplicates>
115 </banDuplicateClasses>
122 <groupId>org.apache.maven.plugins</groupId>
123 <artifactId>maven-resources-plugin</artifactId>
126 <id>test-resources</id>
127 <phase>pre-integration-test</phase>
129 <goal>testResources</goal>
135 <!-- create a maven pom property that has all of our dependencies.
136 below in the integration-test phase we'll pass this list
137 of paths to our jar checker script.
139 <groupId>org.apache.maven.plugins</groupId>
140 <artifactId>maven-dependency-plugin</artifactId>
143 <id>put-client-artifacts-in-a-property</id>
144 <phase>pre-integration-test</phase>
146 <goal>build-classpath</goal>
149 <excludeScope>provided</excludeScope>
150 <excludeTransitive>true</excludeTransitive>
151 <outputProperty>hbase-client-artifacts</outputProperty>
157 <groupId>org.codehaus.mojo</groupId>
158 <artifactId>exec-maven-plugin</artifactId>
159 <version>1.6.0</version>
161 <!-- It's easier to have two copies of our validation
162 script than to copy it via remote-resources-plugin, but
163 we need to make sure they stay the same.
166 <id>make-sure-validation-files-are-in-sync</id>
167 <phase>validate</phase>
172 <executable>diff</executable>
173 <requiresOnline>false</requiresOnline>
175 <argument>../hbase-shaded-with-hadoop-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh</argument>
176 <argument>../hbase-shaded-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh</argument>
181 Check that we actually relocated everything we included.
182 It's critical that we don't ship third party dependencies that haven't
183 been relocated under our package space, since this will lead to
184 difficult to debug classpath errors for downstream. Unfortunately, that
185 means inspecting all the jars.
188 <id>check-jar-contents-for-stuff-with-hadoop</id>
189 <phase>integration-test</phase>
194 <executable>${shell-executable}</executable>
195 <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
196 <requiresOnline>false</requiresOnline>
198 <argument>ensure-jars-have-correct-contents.sh</argument>
199 <argument>--allow-hadoop</argument>
200 <argument>${hbase-client-artifacts}</argument>