Preparing hbase release 2.4.1RC1; tagging and updates to CHANGES.md again
[hbase.git] / hbase-shaded / hbase-shaded-with-hadoop-check-invariants / pom.xml
blob8200d31345fb66807c9c52daa65d0099aac8d7c8
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
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.
12 -->
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>
16   <parent>
17     <artifactId>hbase</artifactId>
18     <groupId>org.apache.hbase</groupId>
19     <version>2.4.1</version>
20     <relativePath>../..</relativePath>
21   </parent>
22   <artifactId>hbase-shaded-with-hadoop-check-invariants</artifactId>
23   <packaging>pom</packaging>
25   <description>
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.
30   </description>
31   <name>Apache HBase Shaded Packaging Invariants (with Hadoop bundled)</name>
33   <properties>
34   </properties>
36   <dependencies>
37     <!-- This should only be client facing artifacts that bundle
38          Apache Hadoop related artifacts.
39       -->
40     <dependency>
41       <groupId>org.apache.hbase</groupId>
42       <artifactId>hbase-shaded-client</artifactId>
43       <version>${project.version}</version>
44     </dependency>
45     <!-- parent pom defines these for children. :( :( :( -->
46     <dependency>
47       <groupId>com.github.stephenc.findbugs</groupId>
48       <artifactId>findbugs-annotations</artifactId>
49       <scope>provided</scope>
50     </dependency>
51     <dependency>
52       <groupId>log4j</groupId>
53       <artifactId>log4j</artifactId>
54       <scope>provided</scope>
55     </dependency>
56     <!-- Test dependencies -->
57     <dependency>
58       <groupId>junit</groupId>
59       <artifactId>junit</artifactId>
60       <scope>provided</scope>
61     </dependency>
62     <dependency>
63       <groupId>org.mockito</groupId>
64       <artifactId>mockito-core</artifactId>
65       <scope>provided</scope>
66     </dependency>
67   </dependencies>
68   <build>
69     <plugins>
70       <plugin>
71         <groupId>org.apache.maven.plugins</groupId>
72         <artifactId>maven-site-plugin</artifactId>
73         <configuration>
74           <skip>true</skip>
75         </configuration>
76       </plugin>
77       <plugin>
78         <groupId>org.apache.maven.plugins</groupId>
79         <artifactId>maven-enforcer-plugin</artifactId>
80         <executions>
81           <execution>
82             <id>enforce-banned-dependencies</id>
83             <goals>
84               <goal>enforce</goal>
85             </goals>
86             <configuration>
87               <skip>true</skip>
88               <rules>
89                 <banTransitiveDependencies>
90 <!--
91                   <message>
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
94     specifics.
95                   </message>
96 -->
97                   <excludes>
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.
110                       -->
111                   </excludes>
112                 </banTransitiveDependencies>
113                 <banDuplicateClasses>
114                   <findAllDuplicates>true</findAllDuplicates>
115                 </banDuplicateClasses>
116               </rules>
117             </configuration>
118           </execution>
119         </executions>
120       </plugin>
121       <plugin>
122         <groupId>org.apache.maven.plugins</groupId>
123         <artifactId>maven-resources-plugin</artifactId>
124         <executions>
125           <execution>
126             <id>test-resources</id>
127             <phase>pre-integration-test</phase>
128             <goals>
129               <goal>testResources</goal>
130             </goals>
131           </execution>
132         </executions>
133       </plugin>
134       <plugin>
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.
138           -->
139         <groupId>org.apache.maven.plugins</groupId>
140         <artifactId>maven-dependency-plugin</artifactId>
141         <executions>
142           <execution>
143             <id>put-client-artifacts-in-a-property</id>
144             <phase>pre-integration-test</phase>
145             <goals>
146               <goal>build-classpath</goal>
147             </goals>
148             <configuration>
149               <excludeScope>provided</excludeScope>
150               <excludeTransitive>true</excludeTransitive>
151               <outputProperty>hbase-client-artifacts</outputProperty>
152             </configuration>
153           </execution>
154         </executions>
155       </plugin>
156       <plugin>
157         <groupId>org.codehaus.mojo</groupId>
158         <artifactId>exec-maven-plugin</artifactId>
159         <version>1.6.0</version>
160         <executions>
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.
164             -->
165           <execution>
166             <id>make-sure-validation-files-are-in-sync</id>
167             <phase>validate</phase>
168             <goals>
169               <goal>exec</goal>
170             </goals>
171             <configuration>
172               <executable>diff</executable>
173               <requiresOnline>false</requiresOnline>
174               <arguments>
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>
177               </arguments>
178             </configuration>
179           </execution>
180           <!--
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.
186             -->
187           <execution>
188             <id>check-jar-contents-for-stuff-with-hadoop</id>
189             <phase>integration-test</phase>
190             <goals>
191               <goal>exec</goal>
192             </goals>
193             <configuration>
194               <executable>${shell-executable}</executable>
195               <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
196               <requiresOnline>false</requiresOnline>
197               <arguments>
198                 <argument>ensure-jars-have-correct-contents.sh</argument>
199                 <argument>--allow-hadoop</argument>
200                 <argument>${hbase-client-artifacts}</argument>
201               </arguments>
202             </configuration>
203           </execution>
204         </executions>
205       </plugin>
206     </plugins>
207   </build>
209 </project>