This is an automated email from the ASF dual-hosted git repository.
Apache9 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new abb75a79acd HBASE-30239 Use hamcrest instead of deprecated
hamcrest-core and hamcrest-library (#8385)
abb75a79acd is described below
commit abb75a79acdfb4238d7865f1514a7b0bec04c2d0
Author: Duo Zhang <[email protected]>
AuthorDate: Sun Jun 21 23:06:06 2026 +0800
HBASE-30239 Use hamcrest instead of deprecated hamcrest-core and
hamcrest-library (#8385)
Signed-off-by: Xiao Liu <[email protected]>
---
hbase-asyncfs/pom.xml | 2 +-
hbase-client/pom.xml | 2 +-
hbase-common/pom.xml | 2 +-
.../hbase-compression-aircompressor/pom.xml | 2 +-
hbase-compression/hbase-compression-brotli/pom.xml | 2 +-
hbase-compression/hbase-compression-lz4/pom.xml | 2 +-
hbase-compression/hbase-compression-snappy/pom.xml | 2 +-
hbase-compression/hbase-compression-zstd/pom.xml | 2 +-
hbase-dev-generate-classpath/pom.xml | 2 +-
hbase-endpoint/pom.xml | 2 +-
hbase-hadoop-compat/pom.xml | 2 +-
hbase-hbtop/pom.xml | 2 +-
hbase-http/pom.xml | 2 +-
hbase-it/pom.xml | 7 +----
hbase-mapreduce/pom.xml | 2 +-
hbase-replication/pom.xml | 7 +----
hbase-rest/pom.xml | 2 +-
hbase-server/pom.xml | 7 +----
hbase-zookeeper/pom.xml | 2 +-
pom.xml | 35 +++++++++++++++-------
20 files changed, 43 insertions(+), 45 deletions(-)
diff --git a/hbase-asyncfs/pom.xml b/hbase-asyncfs/pom.xml
index f149dec3bd2..43c32fa63af 100644
--- a/hbase-asyncfs/pom.xml
+++ b/hbase-asyncfs/pom.xml
@@ -85,7 +85,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index 633377146b1..4d4edcd6bc9 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -193,7 +193,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index e357efc0332..83464480f80 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -138,7 +138,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-compression/hbase-compression-aircompressor/pom.xml
b/hbase-compression/hbase-compression-aircompressor/pom.xml
index b1e90583d53..758790830d0 100644
--- a/hbase-compression/hbase-compression-aircompressor/pom.xml
+++ b/hbase-compression/hbase-compression-aircompressor/pom.xml
@@ -122,7 +122,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-compression/hbase-compression-brotli/pom.xml
b/hbase-compression/hbase-compression-brotli/pom.xml
index f8d3be67112..9ce29672ee4 100644
--- a/hbase-compression/hbase-compression-brotli/pom.xml
+++ b/hbase-compression/hbase-compression-brotli/pom.xml
@@ -107,7 +107,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-compression/hbase-compression-lz4/pom.xml
b/hbase-compression/hbase-compression-lz4/pom.xml
index 69bb74a71ec..ccae663a40b 100644
--- a/hbase-compression/hbase-compression-lz4/pom.xml
+++ b/hbase-compression/hbase-compression-lz4/pom.xml
@@ -106,7 +106,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-compression/hbase-compression-snappy/pom.xml
b/hbase-compression/hbase-compression-snappy/pom.xml
index a514480329a..bea4c82538e 100644
--- a/hbase-compression/hbase-compression-snappy/pom.xml
+++ b/hbase-compression/hbase-compression-snappy/pom.xml
@@ -106,7 +106,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-compression/hbase-compression-zstd/pom.xml
b/hbase-compression/hbase-compression-zstd/pom.xml
index 3560fe7b008..f4d35f4088d 100644
--- a/hbase-compression/hbase-compression-zstd/pom.xml
+++ b/hbase-compression/hbase-compression-zstd/pom.xml
@@ -106,7 +106,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-dev-generate-classpath/pom.xml
b/hbase-dev-generate-classpath/pom.xml
index a248933bd9b..1b9490d3679 100644
--- a/hbase-dev-generate-classpath/pom.xml
+++ b/hbase-dev-generate-classpath/pom.xml
@@ -56,7 +56,7 @@
maven dependency resolution won't pick it up for us. -->
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
+ <artifactId>hamcrest</artifactId>
<!-- Overriding the scope in depMgmt -->
<scope>compile</scope>
</dependency>
diff --git a/hbase-endpoint/pom.xml b/hbase-endpoint/pom.xml
index a8536ecddbb..86ec840fa2e 100644
--- a/hbase-endpoint/pom.xml
+++ b/hbase-endpoint/pom.xml
@@ -201,7 +201,7 @@
them manually. -->
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-hadoop-compat/pom.xml b/hbase-hadoop-compat/pom.xml
index a9e070a1a14..381a5fd6b25 100644
--- a/hbase-hadoop-compat/pom.xml
+++ b/hbase-hadoop-compat/pom.xml
@@ -88,7 +88,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-hbtop/pom.xml b/hbase-hbtop/pom.xml
index 53d73a1b8aa..cf30f631aaf 100644
--- a/hbase-hbtop/pom.xml
+++ b/hbase-hbtop/pom.xml
@@ -70,7 +70,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-http/pom.xml b/hbase-http/pom.xml
index 6168b891791..b4bf291df0c 100644
--- a/hbase-http/pom.xml
+++ b/hbase-http/pom.xml
@@ -141,7 +141,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-it/pom.xml b/hbase-it/pom.xml
index 62b67b63548..137987ce6c9 100644
--- a/hbase-it/pom.xml
+++ b/hbase-it/pom.xml
@@ -203,12 +203,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-mapreduce/pom.xml b/hbase-mapreduce/pom.xml
index d0aa63d79c7..02eedd3a229 100644
--- a/hbase-mapreduce/pom.xml
+++ b/hbase-mapreduce/pom.xml
@@ -193,7 +193,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-replication/pom.xml b/hbase-replication/pom.xml
index 5390bca3294..fcf609217c2 100644
--- a/hbase-replication/pom.xml
+++ b/hbase-replication/pom.xml
@@ -116,12 +116,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-rest/pom.xml b/hbase-rest/pom.xml
index 3975c55ccf5..be512939cfc 100644
--- a/hbase-rest/pom.xml
+++ b/hbase-rest/pom.xml
@@ -215,7 +215,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml
index 8cd7b4bc853..e6929cb6632 100644
--- a/hbase-server/pom.xml
+++ b/hbase-server/pom.xml
@@ -244,7 +244,7 @@
<!-- Test dependencies -->
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -257,11 +257,6 @@
<artifactId>opentelemetry-sdk-testing</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
diff --git a/hbase-zookeeper/pom.xml b/hbase-zookeeper/pom.xml
index 9ce9e8490aa..d98220674c4 100644
--- a/hbase-zookeeper/pom.xml
+++ b/hbase-zookeeper/pom.xml
@@ -126,7 +126,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
+ <artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/pom.xml b/pom.xml
index 591e9916c44..027e45a17a6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -911,7 +911,7 @@
<jruby.version>9.4.14.0</jruby.version>
<junit.jupiter.version>5.13.4</junit.jupiter.version>
<awaitility.version>4.3.0</awaitility.version>
- <hamcrest.version>1.3</hamcrest.version>
+ <hamcrest.version>3.0</hamcrest.version>
<opentelemetry.version>1.49.0</opentelemetry.version>
<opentelemetry-semconv.version>1.29.0-alpha</opentelemetry-semconv.version>
<opentelemetry-javaagent.version>2.26.1</opentelemetry-javaagent.version>
@@ -1682,12 +1682,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
- <version>${hamcrest.version}</version>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
+ <artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>
</dependency>
<dependency>
@@ -2588,6 +2583,24 @@
</rules>
</configuration>
</execution>
+ <execution>
+ <id>banned-hamcrest-core-and-library</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <bannedDependencies>
+ <excludes>
+ <exclude>org.hamcrest:hamcrest-core</exclude>
+ <exclude>org.hamcrest:hamcrest-library</exclude>
+ </excludes>
+ <message>Use org.hamcrest:hamcrest instead</message>
+ <searchTransitive>true</searchTransitive>
+ </bannedDependencies>
+ </rules>
+ </configuration>
+ </execution>
<execution>
<id>check-aggregate-license</id>
<goals>
@@ -3065,7 +3078,7 @@
</additionalDependency>
<additionalDependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
+ <artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>
</additionalDependency>
<!-- javadoc tooling requires jsr305 due to references to it
from things we rely on -->
@@ -3121,7 +3134,7 @@
</additionalDependency>
<additionalDependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
+ <artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>
</additionalDependency>
<!-- javadoc tooling requires jsr305 due to references to it
from things we rely on -->
@@ -3185,7 +3198,7 @@
</additionalDependency>
<additionalDependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
+ <artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>
</additionalDependency>
<!-- javadoc tooling requires jsr305 due to references to it
from things we rely on -->
@@ -3248,7 +3261,7 @@
</additionalDependency>
<additionalDependency>
<groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
+ <artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>
</additionalDependency>
<!-- javadoc tooling requires jsr305 due to references to it
from things we rely on -->