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-SNAPSHOT</version>
20 <relativePath>../..</relativePath>
22 <artifactId>hbase-shaded-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</name>
37 <!-- Include here any client facing artifacts that presume
38 the runtime environment will have hadoop.
40 If our checks fail for the shaded mapreduce artifact,
41 then probably a dependency from hadoop has shown up
42 in the hbase-mapreduce module without being flagged
43 as 'provided' scope. See the note by the relevant
44 hadoop profile in that module.
47 <groupId>org.apache.hbase</groupId>
48 <artifactId>hbase-shaded-mapreduce</artifactId>
49 <version>${project.version}</version>
52 <groupId>org.apache.hbase</groupId>
53 <artifactId>hbase-shaded-client-byo-hadoop</artifactId>
54 <version>${project.version}</version>
56 <!-- parent pom defines these for children. :( :( :( -->
58 <groupId>com.github.stephenc.findbugs</groupId>
59 <artifactId>findbugs-annotations</artifactId>
60 <scope>provided</scope>
63 <groupId>log4j</groupId>
64 <artifactId>log4j</artifactId>
65 <scope>provided</scope>
67 <!-- Test dependencies -->
69 <groupId>junit</groupId>
70 <artifactId>junit</artifactId>
71 <scope>provided</scope>
74 <groupId>org.mockito</groupId>
75 <artifactId>mockito-core</artifactId>
76 <scope>provided</scope>
82 <groupId>org.apache.maven.plugins</groupId>
83 <artifactId>maven-site-plugin</artifactId>
89 <groupId>org.apache.maven.plugins</groupId>
90 <artifactId>maven-enforcer-plugin</artifactId>
93 <id>enforce-banned-dependencies</id>
100 <banTransitiveDependencies>
103 Our client-facing artifacts are not supposed to have additional dependencies
104 and one or more of them do. The output from the enforcer plugin should give
109 <!-- We leave logging stuff alone -->
110 <exclude>org.slf4j:*</exclude>
111 <exclude>log4j:*</exclude>
112 <exclude>commons-logging:*</exclude>
113 <!-- annotations that never change -->
114 <exclude>com.google.code.findbugs:*</exclude>
115 <exclude>com.github.stephenc.findbugs:*</exclude>
116 <exclude>com.github.spotbugs:*</exclude>
117 <!-- We leave HTrace as an unshaded dependnecy on purpose so that tracing within a JVM will work -->
118 <exclude>org.apache.htrace:*</exclude>
119 <!-- Our public API requires Hadoop at runtime to work -->
120 <exclude>org.apache.hadoop:*</exclude>
122 </banTransitiveDependencies>
123 <banDuplicateClasses>
124 <findAllDuplicates>true</findAllDuplicates>
125 </banDuplicateClasses>
132 <groupId>org.apache.maven.plugins</groupId>
133 <artifactId>maven-resources-plugin</artifactId>
136 <id>test-resources</id>
137 <phase>pre-integration-test</phase>
139 <goal>testResources</goal>
145 <!-- create a maven pom property that has all of our dependencies.
146 below in the integration-test phase we'll pass this list
147 of paths to our jar checker script.
149 <groupId>org.apache.maven.plugins</groupId>
150 <artifactId>maven-dependency-plugin</artifactId>
153 <id>put-client-artifacts-in-a-property</id>
154 <phase>pre-integration-test</phase>
156 <goal>build-classpath</goal>
159 <excludeScope>provided</excludeScope>
160 <excludeTransitive>true</excludeTransitive>
161 <outputProperty>hbase-client-artifacts</outputProperty>
167 <groupId>org.codehaus.mojo</groupId>
168 <artifactId>exec-maven-plugin</artifactId>
169 <version>1.6.0</version>
171 <!-- It's easier to have two copies of our validation
172 script than to copy it via remote-resources-plugin, but
173 we need to make sure they stay the same.
176 <id>make-sure-validation-files-are-in-sync</id>
177 <phase>validate</phase>
182 <executable>diff</executable>
183 <requiresOnline>false</requiresOnline>
185 <argument>../hbase-shaded-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh</argument>
186 <argument>../hbase-shaded-with-hadoop-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh</argument>
191 Check that we actually relocated everything we included.
192 It's critical that we don't ship third party dependencies that haven't
193 been relocated under our package space, since this will lead to
194 difficult to debug classpath errors for downstream. Unfortunately, that
195 means inspecting all the jars.
198 <id>check-jar-contents</id>
199 <phase>integration-test</phase>
204 <executable>${shell-executable}</executable>
205 <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
206 <requiresOnline>false</requiresOnline>
207 <!-- Important that we don't pass the 'allow-hadoop' flag here, because
208 we allowed it as a provided dependency above.
211 <argument>ensure-jars-have-correct-contents.sh</argument>
212 <argument>${hbase-client-artifacts}</argument>