Skip to content

Commit 6466128

Browse files
committed
- Improve the handling of how we run IT, other tools in dev environment, now we revert back to directly using cached_classpath.txt to load jars required during runtime (as before). NOTE: To ensure cached_classpath is same as before this change, we retain some jars (including test jars) in assembly pom.xml which we actually remove during tarball creation.
1 parent 35bec8b commit 6466128

4 files changed

Lines changed: 37 additions & 30 deletions

File tree

bin/hbase

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,9 @@ add_opentelemetry_agent() {
525525

526526
#Add the development env class path stuff
527527
if $in_dev_env; then
528+
# The below line makes available all the jars required in dev_env, even if we may not add them
529+
# to assembly. See HBASE-28433 for more info.
528530
add_maven_deps_to_classpath "cached_classpath.txt"
529-
530531
if [[ $jline_needed ]]; then
531532
add_maven_deps_to_classpath "cached_classpath_jline.txt"
532533
elif [[ $jruby_needed ]]; then
@@ -777,17 +778,6 @@ elif [ "$COMMAND" = "copyreppeers" ] ; then
777778
CLASS='org.apache.hadoop.hbase.replication.CopyReplicationPeers'
778779
else
779780
CLASS=$COMMAND
780-
781-
if [[ "$CLASS" =~ .*IntegrationTest.* ]] || [[ "$CLASS" =~ .*Chaos.* ]]; then
782-
for f in ${HBASE_HOME}/lib/test/*.jar; do
783-
if [ -f "${f}" ]; then
784-
CLASSPATH="${CLASSPATH}:${f}"
785-
fi
786-
done
787-
788-
add_jars_from_compiled_source
789-
fi
790-
791781
fi
792782

793783
add_jdk17_jvm_flags

hbase-assembly/pom.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,18 @@
4747
<groupId>org.apache.hbase</groupId>
4848
<artifactId>hbase-shaded-mapreduce</artifactId>
4949
</dependency>
50+
<!-- Intra-project dependencies -->
51+
<!-- We don't really add this to assembly tarball, we retain it here just to dump in into
52+
cached_classpath.txt ! See HBASE-28433 for more info. -->
53+
<dependency>
54+
<groupId>org.apache.hbase</groupId>
55+
<artifactId>hbase-it</artifactId>
56+
<type>test-jar</type>
57+
</dependency>
5058
<!-- Hamcrest is required by hbase-it (via junit), but as long as we're grabbing the hbase-it test-jar,
5159
maven dependency resolution won't pick it up for us. -->
60+
<!-- We don't really add this to assembly tarball, we retain it here just to dump in into
61+
cached_classpath.txt ! See HBASE-28433 for more info. -->
5262
<dependency>
5363
<groupId>org.hamcrest</groupId>
5464
<artifactId>hamcrest-core</artifactId>
@@ -67,11 +77,26 @@
6777
<groupId>org.apache.hbase</groupId>
6878
<artifactId>hbase-mapreduce</artifactId>
6979
</dependency>
80+
<!-- We don't really add this to assembly tarball, we retain it here just to dump in into
81+
cached_classpath.txt ! See HBASE-28433 for more info. -->
82+
<dependency>
83+
<groupId>org.apache.hbase</groupId>
84+
<artifactId>hbase-mapreduce</artifactId>
85+
<type>test-jar</type>
86+
</dependency>
7087
<!-- To dump tools in hbase-procedure into cached_classpath.txt. -->
7188
<dependency>
7289
<groupId>org.apache.hbase</groupId>
7390
<artifactId>hbase-procedure</artifactId>
7491
</dependency>
92+
<!-- We don't really add this to assembly tarball, we retain it here just to dump in into
93+
cached_classpath.txt ! See HBASE-28433 for more info. -->
94+
<dependency>
95+
<groupId>org.apache.hbase</groupId>
96+
<artifactId>hbase-procedure</artifactId>
97+
<type>test-jar</type>
98+
<scope>test</scope>
99+
</dependency>
75100
<dependency>
76101
<groupId>org.apache.hbase</groupId>
77102
<artifactId>hbase-hadoop-compat</artifactId>
@@ -98,6 +123,12 @@
98123
<groupId>org.apache.hbase</groupId>
99124
<artifactId>hbase-external-blockcache</artifactId>
100125
</dependency>
126+
<!-- We don't really add this to assembly tarball, we retain it here just to dump in into
127+
cached_classpath.txt ! See HBASE-28433 for more info. -->
128+
<dependency>
129+
<groupId>org.apache.hbase</groupId>
130+
<artifactId>hbase-testing-util</artifactId>
131+
</dependency>
101132
<dependency>
102133
<groupId>org.apache.hbase</groupId>
103134
<artifactId>hbase-metrics-api</artifactId>
@@ -214,10 +245,14 @@
214245
<groupId>io.opentelemetry.javaagent</groupId>
215246
<artifactId>opentelemetry-javaagent</artifactId>
216247
</dependency>
248+
<!-- We don't really add this to assembly tarball, we retain it here just to dump in into
249+
cached_classpath.txt ! See HBASE-28433 for more info. -->
217250
<dependency>
218251
<groupId>junit</groupId>
219252
<artifactId>junit</artifactId>
220253
</dependency>
254+
<!-- We don't really add this to assembly tarball, we retain it here just to dump in into
255+
cached_classpath.txt ! See HBASE-28433 for more info. -->
221256
<dependency>
222257
<groupId>org.mockito</groupId>
223258
<artifactId>mockito-core</artifactId>

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,6 @@
169169
<include>io.opentelemetry.javaagent:*</include>
170170
</includes>
171171
</dependencySet>
172-
<!-- Adds junit libs to lib/test -->
173-
<dependencySet>
174-
<outputDirectory>lib/test</outputDirectory>
175-
<includes>
176-
<include>junit:junit</include>
177-
<include>org.hamcrest:hamcrest-core</include>
178-
<include>org.mockito:mockito-core</include>
179-
</includes>
180-
</dependencySet>
181172
</dependencySets>
182173

183174
</assembly>

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,6 @@
205205
<include>io.opentelemetry.javaagent:*</include>
206206
</includes>
207207
</dependencySet>
208-
<!-- Adds junit libs to lib/test -->
209-
<dependencySet>
210-
<outputDirectory>lib/test</outputDirectory>
211-
<includes>
212-
<include>junit:junit</include>
213-
<include>org.hamcrest:hamcrest-core</include>
214-
<include>org.mockito:mockito-core</include>
215-
</includes>
216-
</dependencySet>
217208
</dependencySets>
218209

219210
</assembly>

0 commit comments

Comments
 (0)