Skip to content

Commit 1b5403c

Browse files
authored
HBASE-27340 Artifacts with resolved profiles (#4740) (#4761)
(Forward port from branch-2; simplified by the fact that there is no hadoop-2.0 profile on master branch) Make it so our published poms carry the minimum needed to run an hbase; the published pom has no profiles -- the profiles specified at build time are resolved, their dependencies inlined, and then they are stripped -- and no build-time, or plugins dependencies or properties, etc. Resultant poms have explicit hadoop lib versions baked in -- no more being able to choose hbase with hadoop2 or haddop3 at downstream build time by setting a '-Dhadoop.profile=X.0'. Pattern is to add profiles when none in sub-modules when the flatten plugin complains it can't resolve an hadoop dependency's 'version' (e.g. hadoop-common, hadoop-hdfs). Adding the profile in the sub-module make it so the flatten plugin can figure 'hadoop.version' definitively. (In master there is only the hadoop-3.0 profile). Another spin on the above happens when profiles already exist in submodule but the flatten plugin is complaining it can't figure figure version on an hadoop dependency NOT under profiles. Below, we move the delinquent hadoop dependency under existing profiles (minikdc was the usual dependency outside profiles in sub-modules that flatten complained about). Sometimes, moving an hadoop dependency under a profile, there would be excludes on the local dependency. If the parent pom excludes section was missing the local excludes, we added them up to the parent module so all excluding is done up there in the parent profile dependencyManagement section. Signed-off-by: Duo Zhang <zhangduo@apache.org>
1 parent 72c1a84 commit 1b5403c

File tree

12 files changed

+205
-146
lines changed

12 files changed

+205
-146
lines changed

hbase-asyncfs/pom.xml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,6 @@
7878
<artifactId>bcprov-jdk15on</artifactId>
7979
<scope>test</scope>
8080
</dependency>
81-
<dependency>
82-
<groupId>org.apache.hadoop</groupId>
83-
<artifactId>hadoop-minikdc</artifactId>
84-
<scope>test</scope>
85-
<exclusions>
86-
<exclusion>
87-
<groupId>bouncycastle</groupId>
88-
<artifactId>bcprov-jdk15</artifactId>
89-
</exclusion>
90-
</exclusions>
91-
</dependency>
9281
<dependency>
9382
<groupId>org.apache.kerby</groupId>
9483
<artifactId>kerb-client</artifactId>
@@ -206,6 +195,11 @@
206195
<artifactId>hadoop-minicluster</artifactId>
207196
<scope>test</scope>
208197
</dependency>
198+
<dependency>
199+
<groupId>org.apache.hadoop</groupId>
200+
<artifactId>hadoop-minikdc</artifactId>
201+
<scope>test</scope>
202+
</dependency>
209203
</dependencies>
210204
</profile>
211205
<profile>

hbase-balancer/pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@
5858
<groupId>org.apache.hbase</groupId>
5959
<artifactId>hbase-client</artifactId>
6060
</dependency>
61-
<dependency>
62-
<groupId>org.apache.hadoop</groupId>
63-
<artifactId>hadoop-hdfs-client</artifactId>
64-
</dependency>
65-
<dependency>
66-
<groupId>org.apache.hadoop</groupId>
67-
<artifactId>hadoop-hdfs</artifactId>
68-
</dependency>
6961
<dependency>
7062
<groupId>org.slf4j</groupId>
7163
<artifactId>slf4j-api</artifactId>
@@ -166,6 +158,14 @@
166158
<groupId>org.apache.hadoop</groupId>
167159
<artifactId>hadoop-common</artifactId>
168160
</dependency>
161+
<dependency>
162+
<groupId>org.apache.hadoop</groupId>
163+
<artifactId>hadoop-hdfs-client</artifactId>
164+
</dependency>
165+
<dependency>
166+
<groupId>org.apache.hadoop</groupId>
167+
<artifactId>hadoop-hdfs</artifactId>
168+
</dependency>
169169
</dependencies>
170170
</profile>
171171
<profile>

hbase-endpoint/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,6 @@
138138
<type>test-jar</type>
139139
<scope>test</scope>
140140
</dependency>
141-
<dependency>
142-
<groupId>org.apache.hadoop</groupId>
143-
<artifactId>hadoop-minikdc</artifactId>
144-
<scope>test</scope>
145-
</dependency>
146141
<!-- General dependencies -->
147142
<dependency>
148143
<groupId>org.slf4j</groupId>
@@ -292,6 +287,11 @@
292287
<version>3.6.2.Final</version>
293288
<scope>test</scope>
294289
</dependency>
290+
<dependency>
291+
<groupId>org.apache.hadoop</groupId>
292+
<artifactId>hadoop-minikdc</artifactId>
293+
<scope>test</scope>
294+
</dependency>
295295
</dependencies>
296296
</profile>
297297
<profile>

hbase-examples/pom.xml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,6 @@
150150
<artifactId>mockito-core</artifactId>
151151
<scope>test</scope>
152152
</dependency>
153-
<dependency>
154-
<groupId>org.apache.hadoop</groupId>
155-
<artifactId>hadoop-minikdc</artifactId>
156-
<scope>test</scope>
157-
<exclusions>
158-
<exclusion>
159-
<groupId>bouncycastle</groupId>
160-
<artifactId>bcprov-jdk15</artifactId>
161-
</exclusion>
162-
</exclusions>
163-
</dependency>
164153
<dependency>
165154
<groupId>org.bouncycastle</groupId>
166155
<artifactId>bcprov-jdk15on</artifactId>
@@ -336,6 +325,11 @@
336325
</exclusion>
337326
</exclusions>
338327
</dependency>
328+
<dependency>
329+
<groupId>org.apache.hadoop</groupId>
330+
<artifactId>hadoop-minikdc</artifactId>
331+
<scope>test</scope>
332+
</dependency>
339333
</dependencies>
340334
<build>
341335
<plugins>

hbase-hadoop-compat/pom.xml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -67,32 +67,6 @@
6767
<groupId>org.apache.hbase.thirdparty</groupId>
6868
<artifactId>hbase-shaded-miscellaneous</artifactId>
6969
</dependency>
70-
<dependency>
71-
<groupId>org.apache.hadoop</groupId>
72-
<artifactId>hadoop-mapreduce-client-core</artifactId>
73-
<exclusions>
74-
<exclusion>
75-
<groupId>com.google.guava</groupId>
76-
<artifactId>guava</artifactId>
77-
</exclusion>
78-
</exclusions>
79-
</dependency>
80-
<dependency>
81-
<groupId>org.apache.hadoop</groupId>
82-
<artifactId>hadoop-common</artifactId>
83-
</dependency>
84-
<dependency>
85-
<groupId>org.slf4j</groupId>
86-
<artifactId>slf4j-api</artifactId>
87-
</dependency>
88-
<dependency>
89-
<!--
90-
a missing transitive dependency on JDK9+ (obsoleted by Hadoop-3.3.0+, HADOOP-15775)
91-
-->
92-
<groupId>javax.activation</groupId>
93-
<artifactId>javax.activation-api</artifactId>
94-
<scope>runtime</scope>
95-
</dependency>
9670
<dependency>
9771
<groupId>org.apache.commons</groupId>
9872
<artifactId>commons-lang3</artifactId>
@@ -201,6 +175,42 @@
201175
</pluginManagement>
202176
</build>
203177
</profile>
178+
<profile>
179+
<id>hadoop-3.0</id>
180+
<activation>
181+
<property>
182+
<name>!hadoop.profile</name>
183+
</property>
184+
</activation>
185+
<dependencies>
186+
<dependency>
187+
<groupId>org.apache.hadoop</groupId>
188+
<artifactId>hadoop-mapreduce-client-core</artifactId>
189+
<exclusions>
190+
<exclusion>
191+
<groupId>com.google.guava</groupId>
192+
<artifactId>guava</artifactId>
193+
</exclusion>
194+
</exclusions>
195+
</dependency>
196+
<dependency>
197+
<groupId>org.apache.hadoop</groupId>
198+
<artifactId>hadoop-common</artifactId>
199+
</dependency>
200+
<dependency>
201+
<groupId>org.slf4j</groupId>
202+
<artifactId>slf4j-api</artifactId>
203+
</dependency>
204+
<dependency>
205+
<!--
206+
a missing transitive dependency on JDK9+ (obsoleted by Hadoop-3.3.0+, HADOOP-15775)
207+
-->
208+
<groupId>javax.activation</groupId>
209+
<artifactId>javax.activation-api</artifactId>
210+
<scope>runtime</scope>
211+
</dependency>
212+
</dependencies>
213+
</profile>
204214
</profiles>
205215

206216
</project>

hbase-http/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@
144144
<artifactId>mockito-core</artifactId>
145145
<scope>test</scope>
146146
</dependency>
147-
<dependency>
148-
<groupId>org.apache.hadoop</groupId>
149-
<artifactId>hadoop-minikdc</artifactId>
150-
<scope>test</scope>
151-
</dependency>
152147
<dependency>
153148
<groupId>org.slf4j</groupId>
154149
<artifactId>jcl-over-slf4j</artifactId>
@@ -376,6 +371,11 @@
376371
<groupId>com.fasterxml.jackson.core</groupId>
377372
<artifactId>jackson-core</artifactId>
378373
</dependency>
374+
<dependency>
375+
<groupId>org.apache.hadoop</groupId>
376+
<artifactId>hadoop-minikdc</artifactId>
377+
<scope>test</scope>
378+
</dependency>
379379
</dependencies>
380380
<build>
381381
<plugins>

hbase-mapreduce/pom.xml

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -159,41 +159,6 @@
159159
<scope>compile</scope>
160160
<optional>true</optional>
161161
</dependency>
162-
<dependency>
163-
<groupId>org.apache.hadoop</groupId>
164-
<artifactId>hadoop-mapreduce-client-jobclient</artifactId>
165-
<type>test-jar</type>
166-
<scope>test</scope>
167-
<exclusions>
168-
<exclusion>
169-
<groupId>org.codehaus.jackson</groupId>
170-
<artifactId>jackson-mapper-asl</artifactId>
171-
</exclusion>
172-
<exclusion>
173-
<groupId>org.codehaus.jackson</groupId>
174-
<artifactId>jackson-core-asl</artifactId>
175-
</exclusion>
176-
<exclusion>
177-
<groupId>javax.xml.bind</groupId>
178-
<artifactId>jaxb-api</artifactId>
179-
</exclusion>
180-
<exclusion>
181-
<groupId>javax.ws.rs</groupId>
182-
<artifactId>jsr311-api</artifactId>
183-
</exclusion>
184-
</exclusions>
185-
</dependency>
186-
<dependency>
187-
<groupId>org.apache.hadoop</groupId>
188-
<artifactId>hadoop-hdfs</artifactId>
189-
<type>test-jar</type>
190-
<scope>test</scope>
191-
</dependency>
192-
<dependency>
193-
<groupId>org.apache.hadoop</groupId>
194-
<artifactId>hadoop-minikdc</artifactId>
195-
<scope>test</scope>
196-
</dependency>
197162
<dependency>
198163
<groupId>org.mockito</groupId>
199164
<artifactId>mockito-core</artifactId>
@@ -246,6 +211,11 @@
246211
<artifactId>log4j-1.2-api</artifactId>
247212
<scope>test</scope>
248213
</dependency>
214+
<dependency>
215+
<groupId>org.bouncycastle</groupId>
216+
<artifactId>bcprov-jdk15on</artifactId>
217+
<scope>test</scope>
218+
</dependency>
249219
</dependencies>
250220

251221
<build>
@@ -312,6 +282,12 @@
312282
<groupId>org.apache.hadoop</groupId>
313283
<artifactId>hadoop-hdfs</artifactId>
314284
</dependency>
285+
<dependency>
286+
<groupId>org.apache.hadoop</groupId>
287+
<artifactId>hadoop-hdfs</artifactId>
288+
<type>test-jar</type>
289+
<scope>test</scope>
290+
</dependency>
315291
<dependency>
316292
<!--maven dependency:analyze says not needed but tests fail w/o-->
317293
<groupId>org.apache.hadoop</groupId>
@@ -324,6 +300,35 @@
324300
</exclusion>
325301
</exclusions>
326302
</dependency>
303+
<dependency>
304+
<groupId>org.apache.hadoop</groupId>
305+
<artifactId>hadoop-minikdc</artifactId>
306+
<scope>test</scope>
307+
</dependency>
308+
<dependency>
309+
<groupId>org.apache.hadoop</groupId>
310+
<artifactId>hadoop-mapreduce-client-jobclient</artifactId>
311+
<type>test-jar</type>
312+
<scope>test</scope>
313+
<exclusions>
314+
<exclusion>
315+
<groupId>org.codehaus.jackson</groupId>
316+
<artifactId>jackson-mapper-asl</artifactId>
317+
</exclusion>
318+
<exclusion>
319+
<groupId>org.codehaus.jackson</groupId>
320+
<artifactId>jackson-core-asl</artifactId>
321+
</exclusion>
322+
<exclusion>
323+
<groupId>javax.xml.bind</groupId>
324+
<artifactId>jaxb-api</artifactId>
325+
</exclusion>
326+
<exclusion>
327+
<groupId>javax.ws.rs</groupId>
328+
<artifactId>jsr311-api</artifactId>
329+
</exclusion>
330+
</exclusions>
331+
</dependency>
327332
</dependencies>
328333
</profile>
329334
<profile>

hbase-procedure/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@
115115
<artifactId>log4j-slf4j-impl</artifactId>
116116
<scope>test</scope>
117117
</dependency>
118-
<dependency>
119-
<groupId>org.apache.hadoop</groupId>
120-
<artifactId>hadoop-hdfs-client</artifactId>
121-
</dependency>
122118
</dependencies>
123119
<!--REMOVE-->
124120

@@ -178,6 +174,10 @@
178174
<groupId>org.apache.hadoop</groupId>
179175
<artifactId>hadoop-common</artifactId>
180176
</dependency>
177+
<dependency>
178+
<groupId>org.apache.hadoop</groupId>
179+
<artifactId>hadoop-hdfs-client</artifactId>
180+
</dependency>
181181
</dependencies>
182182
</profile>
183183
</profiles>

hbase-rest/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,6 @@
210210
<artifactId>kerb-simplekdc</artifactId>
211211
<scope>test</scope>
212212
</dependency>
213-
<dependency>
214-
<groupId>org.apache.hadoop</groupId>
215-
<artifactId>hadoop-minikdc</artifactId>
216-
<scope>test</scope>
217-
</dependency>
218213
<dependency>
219214
<groupId>org.apache.kerby</groupId>
220215
<artifactId>kerb-core</artifactId>
@@ -457,6 +452,11 @@
457452
<groupId>org.apache.hadoop</groupId>
458453
<artifactId>hadoop-auth</artifactId>
459454
</dependency>
455+
<dependency>
456+
<groupId>org.apache.hadoop</groupId>
457+
<artifactId>hadoop-minikdc</artifactId>
458+
<scope>test</scope>
459+
</dependency>
460460
</dependencies>
461461
</profile>
462462
<profile>

hbase-server/pom.xml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,6 @@
258258
<artifactId>bcprov-jdk15on</artifactId>
259259
<scope>test</scope>
260260
</dependency>
261-
<dependency>
262-
<groupId>org.apache.hadoop</groupId>
263-
<artifactId>hadoop-minikdc</artifactId>
264-
<scope>test</scope>
265-
<exclusions>
266-
<exclusion>
267-
<groupId>bouncycastle</groupId>
268-
<artifactId>bcprov-jdk15</artifactId>
269-
</exclusion>
270-
</exclusions>
271-
</dependency>
272261
<dependency>
273262
<groupId>org.apache.kerby</groupId>
274263
<artifactId>kerb-client</artifactId>
@@ -711,6 +700,11 @@
711700
<version>${netty.hadoop.version}</version>
712701
<scope>test</scope>
713702
</dependency-->
703+
<dependency>
704+
<groupId>org.apache.hadoop</groupId>
705+
<artifactId>hadoop-minikdc</artifactId>
706+
<scope>test</scope>
707+
</dependency>
714708
</dependencies>
715709
<build>
716710
<plugins>

0 commit comments

Comments
 (0)