Skip to content

Commit 46190f0

Browse files
committed
HBASE-28433 Modify the assembly to not include test jars and their transitive dependencies
1 parent 84f4fb3 commit 46190f0

File tree

12 files changed

+14
-205
lines changed

12 files changed

+14
-205
lines changed

bin/hbase

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ fi
340340

341341
#If configured and available, add Hadoop to the CLASSPATH and to the JAVA_LIBRARY_PATH
342342
if [ -n "${HADOOP_IN_PATH}" ] && [ -f "${HADOOP_IN_PATH}" ]; then
343+
# TODO: Drop/Modify this logic
343344
# If built hbase, temporarily add hbase-server*.jar to classpath for GetJavaProperty
344345
# Exclude hbase-server*-tests.jar
345346
temporary_cp=
@@ -766,13 +767,6 @@ elif [ "$COMMAND" = "copyreppeers" ] ; then
766767
CLASS='org.apache.hadoop.hbase.replication.CopyReplicationPeers'
767768
else
768769
CLASS=$COMMAND
769-
if [[ "$CLASS" =~ .*IntegrationTest.* ]] ; then
770-
for f in ${HBASE_HOME}/lib/test/*.jar; do
771-
if [ -f "${f}" ]; then
772-
CLASSPATH="${CLASSPATH}:${f}"
773-
fi
774-
done
775-
fi
776770
fi
777771

778772
add_jdk17_jvm_flags

hbase-assembly/pom.xml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,6 @@
4747
<groupId>org.apache.hbase</groupId>
4848
<artifactId>hbase-shaded-mapreduce</artifactId>
4949
</dependency>
50-
<!-- Intra-project dependencies -->
51-
<dependency>
52-
<groupId>org.apache.hbase</groupId>
53-
<artifactId>hbase-it</artifactId>
54-
<type>test-jar</type>
55-
</dependency>
56-
<!-- Hamcrest is required by hbase-it (via junit), but as long as we're grabbing the hbase-it test-jar,
57-
maven dependency resolution won't pick it up for us. -->
58-
<dependency>
59-
<groupId>org.hamcrest</groupId>
60-
<artifactId>hamcrest-core</artifactId>
61-
<!-- Overriding the scope in depMgmt -->
62-
<scope>compile</scope>
63-
</dependency>
6450
<dependency>
6551
<groupId>org.apache.hbase</groupId>
6652
<artifactId>hbase-openssl</artifactId>
@@ -73,22 +59,11 @@
7359
<groupId>org.apache.hbase</groupId>
7460
<artifactId>hbase-mapreduce</artifactId>
7561
</dependency>
76-
<dependency>
77-
<groupId>org.apache.hbase</groupId>
78-
<artifactId>hbase-mapreduce</artifactId>
79-
<type>test-jar</type>
80-
</dependency>
8162
<!-- To dump tools in hbase-procedure into cached_classpath.txt. -->
8263
<dependency>
8364
<groupId>org.apache.hbase</groupId>
8465
<artifactId>hbase-procedure</artifactId>
8566
</dependency>
86-
<dependency>
87-
<groupId>org.apache.hbase</groupId>
88-
<artifactId>hbase-procedure</artifactId>
89-
<type>test-jar</type>
90-
<scope>test</scope>
91-
</dependency>
9267
<dependency>
9368
<groupId>org.apache.hbase</groupId>
9469
<artifactId>hbase-hadoop-compat</artifactId>
@@ -115,10 +90,6 @@
11590
<groupId>org.apache.hbase</groupId>
11691
<artifactId>hbase-external-blockcache</artifactId>
11792
</dependency>
118-
<dependency>
119-
<groupId>org.apache.hbase</groupId>
120-
<artifactId>hbase-testing-util</artifactId>
121-
</dependency>
12293
<dependency>
12394
<groupId>org.apache.hbase</groupId>
12495
<artifactId>hbase-metrics-api</artifactId>
@@ -235,17 +206,6 @@
235206
<groupId>io.opentelemetry.javaagent</groupId>
236207
<artifactId>opentelemetry-javaagent</artifactId>
237208
</dependency>
238-
<dependency>
239-
<groupId>junit</groupId>
240-
<artifactId>junit</artifactId>
241-
</dependency>
242-
<dependency>
243-
<groupId>org.mockito</groupId>
244-
<artifactId>mockito-core</artifactId>
245-
<!-- Making it compile here so that it can be downloaded during packaging. -->
246-
<!-- All other modules scope it as test or inherit test scope from parent pom. -->
247-
<scope>compile</scope>
248-
</dependency>
249209
</dependencies>
250210
<build>
251211
<plugins>

hbase-assembly/src/main/assembly/client-components.xml

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -87,60 +87,5 @@
8787
<include>*.dylib</include>
8888
</includes>
8989
</fileSet>
90-
<!-- This is only necessary until maven fixes the intra-project dependency bug
91-
in maven 3.0. Until then, we have to include the test jars for sub-projects. When
92-
fixed, the below dependencySet stuff is sufficient for pulling in the test jars as
93-
well, as long as they are added as dependencies in this project. Right now, we only
94-
have 1 submodule to accumulate, but we can copy/paste as necessary until maven is
95-
fixed. -->
96-
<!-- Used by PE and ltt -->
97-
<fileSet>
98-
<directory>${project.basedir}/../hbase-server/target/</directory>
99-
<outputDirectory>lib</outputDirectory>
100-
<includes>
101-
<include>${server.test.jar}</include>
102-
</includes>
103-
<fileMode>0644</fileMode>
104-
</fileSet>
105-
<fileSet>
106-
<directory>${project.basedir}/../hbase-mapreduce/target/</directory>
107-
<outputDirectory>lib</outputDirectory>
108-
<includes>
109-
<include>${mapreduce.test.jar}</include>
110-
</includes>
111-
<fileMode>0644</fileMode>
112-
</fileSet>
113-
<fileSet>
114-
<directory>${project.basedir}/../hbase-common/target/</directory>
115-
<outputDirectory>lib</outputDirectory>
116-
<includes>
117-
<include>${common.test.jar}</include>
118-
</includes>
119-
<fileMode>0644</fileMode>
120-
</fileSet>
121-
<fileSet>
122-
<directory>${project.basedir}/../hbase-asyncfs/target/</directory>
123-
<outputDirectory>lib</outputDirectory>
124-
<includes>
125-
<include>${asyncfs.test.jar}</include>
126-
</includes>
127-
<fileMode>0644</fileMode>
128-
</fileSet>
129-
<fileSet>
130-
<directory>${project.basedir}/../hbase-zookeeper/target/</directory>
131-
<outputDirectory>lib</outputDirectory>
132-
<includes>
133-
<include>${zookeeper.test.jar}</include>
134-
</includes>
135-
<fileMode>0644</fileMode>
136-
</fileSet>
137-
<fileSet>
138-
<directory>${project.basedir}/../hbase-procedure/target/</directory>
139-
<outputDirectory>lib</outputDirectory>
140-
<includes>
141-
<include>${procedure.test.jar}</include>
142-
</includes>
143-
<fileMode>0644</fileMode>
144-
</fileSet>
14590
</fileSets>
14691
</component>

hbase-assembly/src/main/assembly/client.xml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@
4444
<outputDirectory>lib</outputDirectory>
4545
<dependencySets>
4646
<dependencySet>
47+
<useTransitiveFiltering>false</useTransitiveFiltering>
4748
<excludes>
49+
<exclude>org.apache.hadoop:*:test-jar</exclude>
50+
<exclude>org.apache.hbase:*:test-jar</exclude>
4851
<!-- Exclude J2EE libraries that get pulled in when building on JDK11 -->
4952
<exclude>com.sun.xml.ws:jaxws-ri</exclude>
5053
<!-- Exclude libraries that we put in their own dirs under lib/ -->
@@ -167,15 +170,6 @@
167170
<include>io.opentelemetry.javaagent:*</include>
168171
</includes>
169172
</dependencySet>
170-
<!-- Adds junit libs to lib/test -->
171-
<dependencySet>
172-
<outputDirectory>lib/test</outputDirectory>
173-
<includes>
174-
<include>junit:junit</include>
175-
<include>org.hamcrest:hamcrest-core</include>
176-
<include>org.mockito:mockito-core</include>
177-
</includes>
178-
</dependencySet>
179173
</dependencySets>
180174

181175
</assembly>

hbase-assembly/src/main/assembly/components.xml

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -109,75 +109,5 @@
109109
<include>**/*.h</include>
110110
</includes>
111111
</fileSet>
112-
<!-- This is only necessary until maven fixes the intra-project dependency bug
113-
in maven 3.0. Until then, we have to include the test jars for sub-projects. When
114-
fixed, the below dependencySet stuff is sufficient for pulling in the test jars as
115-
well, as long as they are added as dependencies in this project. Right now, we only
116-
have 1 submodule to accumulate, but we can copy/paste as necessary until maven is
117-
fixed. -->
118-
<fileSet>
119-
<directory>${project.basedir}/../hbase-server/target/</directory>
120-
<outputDirectory>lib</outputDirectory>
121-
<includes>
122-
<include>${server.test.jar}</include>
123-
</includes>
124-
<fileMode>0644</fileMode>
125-
</fileSet>
126-
<fileSet>
127-
<directory>${project.basedir}/../hbase-it/target/</directory>
128-
<outputDirectory>lib</outputDirectory>
129-
<includes>
130-
<include>${it.test.jar}</include>
131-
</includes>
132-
<fileMode>0644</fileMode>
133-
</fileSet>
134-
<fileSet>
135-
<directory>${project.basedir}/../hbase-annotations/target/</directory>
136-
<outputDirectory>lib</outputDirectory>
137-
<includes>
138-
<include>${annotations.test.jar}</include>
139-
</includes>
140-
<fileMode>0644</fileMode>
141-
</fileSet>
142-
<fileSet>
143-
<directory>${project.basedir}/../hbase-common/target/</directory>
144-
<outputDirectory>lib</outputDirectory>
145-
<includes>
146-
<include>${common.test.jar}</include>
147-
</includes>
148-
<fileMode>0644</fileMode>
149-
</fileSet>
150-
<fileSet>
151-
<directory>${project.basedir}/../hbase-mapreduce/target/</directory>
152-
<outputDirectory>lib</outputDirectory>
153-
<includes>
154-
<include>${mapreduce.test.jar}</include>
155-
</includes>
156-
<fileMode>0644</fileMode>
157-
</fileSet>
158-
<fileSet>
159-
<directory>${project.basedir}/../hbase-asyncfs/target/</directory>
160-
<outputDirectory>lib</outputDirectory>
161-
<includes>
162-
<include>${asyncfs.test.jar}</include>
163-
</includes>
164-
<fileMode>0644</fileMode>
165-
</fileSet>
166-
<fileSet>
167-
<directory>${project.basedir}/../hbase-zookeeper/target/</directory>
168-
<outputDirectory>lib</outputDirectory>
169-
<includes>
170-
<include>${zookeeper.test.jar}</include>
171-
</includes>
172-
<fileMode>0644</fileMode>
173-
</fileSet>
174-
<fileSet>
175-
<directory>${project.basedir}/../hbase-procedure/target/</directory>
176-
<outputDirectory>lib</outputDirectory>
177-
<includes>
178-
<include>${procedure.test.jar}</include>
179-
</includes>
180-
<fileMode>0644</fileMode>
181-
</fileSet>
182112
</fileSets>
183113
</component>

hbase-assembly/src/main/assembly/hadoop-three-compat.xml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
<useAllReactorProjects>true</useAllReactorProjects>
3434
<includes>
3535
<!-- Keep this list sorted by name -->
36-
<include>org.apache.hbase:hbase-annotations</include>
3736
<include>org.apache.hbase:hbase-asyncfs</include>
3837
<include>org.apache.hbase:hbase-backup</include>
3938
<include>org.apache.hbase:hbase-balancer</include>
@@ -43,7 +42,6 @@
4342
<include>org.apache.hbase:hbase-external-blockcache</include>
4443
<include>org.apache.hbase:hbase-hadoop-compat</include>
4544
<include>org.apache.hbase:hbase-http</include>
46-
<include>org.apache.hbase:hbase-it</include>
4745
<include>org.apache.hbase:hbase-logging</include>
4846
<include>org.apache.hbase:hbase-mapreduce</include>
4947
<include>org.apache.hbase:hbase-diagnostics</include>
@@ -55,7 +53,6 @@
5553
<include>org.apache.hbase:hbase-rest</include>
5654
<include>org.apache.hbase:hbase-server</include>
5755
<include>org.apache.hbase:hbase-shell</include>
58-
<include>org.apache.hbase:hbase-testing-util</include>
5956
<include>org.apache.hbase:hbase-thrift</include>
6057
<include>org.apache.hbase:hbase-zookeeper</include>
6158
</includes>
@@ -65,7 +62,10 @@
6562
<unpack>false</unpack>
6663
<dependencySets>
6764
<dependencySet>
65+
<useTransitiveFiltering>false</useTransitiveFiltering>
6866
<excludes>
67+
<exclude>org.apache.hadoop:*:test-jar</exclude>
68+
<exclude>org.apache.hbase:*:test-jar</exclude>
6969
<!-- Exclude pom file -->
7070
<exclude>com.sun.xml.ws:jaxws-ri:pom</exclude>
7171
<!-- Exclude libraries that we put in their own dirs under lib/ -->
@@ -206,16 +206,6 @@
206206
<include>io.opentelemetry.javaagent:*</include>
207207
</includes>
208208
</dependencySet>
209-
210-
<!-- Adds junit libs to lib/test -->
211-
<dependencySet>
212-
<outputDirectory>lib/test</outputDirectory>
213-
<includes>
214-
<include>junit:junit</include>
215-
<include>org.hamcrest:hamcrest-core</include>
216-
<include>org.mockito:mockito-core</include>
217-
</includes>
218-
</dependencySet>
219209
</dependencySets>
220210

221211
</assembly>

hbase-endpoint/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@
261261
<dependency>
262262
<groupId>org.apache.hadoop</groupId>
263263
<artifactId>hadoop-minicluster</artifactId>
264+
<scope>test</scope>
264265
<exclusions>
265266
<exclusion>
266267
<groupId>com.google.guava</groupId>

hbase-examples/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@
315315
<dependency>
316316
<groupId>org.apache.hadoop</groupId>
317317
<artifactId>hadoop-minicluster</artifactId>
318+
<scope>test</scope>
318319
<exclusions>
319320
<exclusion>
320321
<groupId>javax.xml.bind.</groupId>

hbase-it/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@
375375
<dependency>
376376
<groupId>org.apache.hadoop</groupId>
377377
<artifactId>hadoop-minicluster</artifactId>
378+
<scope>test</scope>
378379
<exclusions>
379380
<exclusion>
380381
<groupId>javax.xml.bind</groupId>
@@ -389,6 +390,7 @@
389390
<dependency>
390391
<groupId>org.apache.hadoop</groupId>
391392
<artifactId>hadoop-minikdc</artifactId>
393+
<scope>test</scope>
392394
</dependency>
393395
</dependencies>
394396
<build>

hbase-shell/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@
195195
<dependency>
196196
<groupId>org.apache.hadoop</groupId>
197197
<artifactId>hadoop-minicluster</artifactId>
198+
<scope>test</scope>
198199
<exclusions>
199200
<exclusion>
200201
<groupId>com.google.guava</groupId>
@@ -209,6 +210,7 @@
209210
<dependency>
210211
<groupId>org.apache.hadoop</groupId>
211212
<artifactId>hadoop-minikdc</artifactId>
213+
<scope>test</scope>
212214
</dependency>
213215
</dependencies>
214216
<build>

hbase-thrift/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@
437437
<dependency>
438438
<groupId>org.apache.hadoop</groupId>
439439
<artifactId>hadoop-minicluster</artifactId>
440+
<scope>test</scope>
440441
<exclusions>
441442
<exclusion>
442443
<groupId>com.google.guava</groupId>

pom.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -937,17 +937,6 @@
937937
<jacoco.version>0.8.8</jacoco.version>
938938
<jacocoArgLine/>
939939
<sonar-maven-plugin.version>3.9.1.2184</sonar-maven-plugin.version>
940-
<!-- Intraproject jar naming properties -->
941-
<!-- TODO this is pretty ugly, but works for the moment.
942-
Modules are pretty heavy-weight things, so doing this work isn't too bad. -->
943-
<server.test.jar>hbase-server-${project.version}-tests.jar</server.test.jar>
944-
<common.test.jar>hbase-common-${project.version}-tests.jar</common.test.jar>
945-
<procedure.test.jar>hbase-procedure-${project.version}-tests.jar</procedure.test.jar>
946-
<it.test.jar>hbase-it-${project.version}-tests.jar</it.test.jar>
947-
<annotations.test.jar>hbase-annotations-${project.version}-tests.jar</annotations.test.jar>
948-
<mapreduce.test.jar>hbase-mapreduce-${project.version}-tests.jar</mapreduce.test.jar>
949-
<zookeeper.test.jar>hbase-zookeeper-${project.version}-tests.jar</zookeeper.test.jar>
950-
<asyncfs.test.jar>hbase-asyncfs-${project.version}-tests.jar</asyncfs.test.jar>
951940
<shell-executable>bash</shell-executable>
952941
<surefire.provider>surefire-junit47</surefire.provider>
953942
<!-- default: run small & medium, medium with 2 threads -->

0 commit comments

Comments
 (0)