This is an automated email from the ASF dual-hosted git repository.

Apache9 pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.5 by this push:
     new 86809687afb HBASE-30239 Use hamcrest instead of deprecated 
hamcrest-core and hamcrest-library (#8385) (#8388)
86809687afb is described below

commit 86809687afb0799b6ac8cfdc7088f0ba6aa0edb8
Author: Duo Zhang <[email protected]>
AuthorDate: Mon Jun 22 23:27:58 2026 +0800

    HBASE-30239 Use hamcrest instead of deprecated hamcrest-core and 
hamcrest-library (#8385) (#8388)
    
    (cherry picked from commit abb75a79acdfb4238d7865f1514a7b0bec04c2d0)
    
    Signed-off-by: Xiao Liu <[email protected]>
---
 hbase-assembly/pom.xml                             |  4 +--
 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-xz/pom.xml     |  2 +-
 hbase-compression/hbase-compression-zstd/pom.xml   |  2 +-
 hbase-endpoint/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                          |  2 +-
 .../src/main/resources/supplemental-models.xml     | 13 ++++++++
 hbase-rest/pom.xml                                 |  2 +-
 hbase-server/pom.xml                               |  7 +----
 hbase-testing-util/pom.xml                         |  2 +-
 hbase-zookeeper/pom.xml                            |  2 +-
 pom.xml                                            | 35 +++++++++++++++-------
 22 files changed, 58 insertions(+), 42 deletions(-)

diff --git a/hbase-assembly/pom.xml b/hbase-assembly/pom.xml
index 9967fef9586..2664ebb04f6 100644
--- a/hbase-assembly/pom.xml
+++ b/hbase-assembly/pom.xml
@@ -57,7 +57,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>
@@ -404,7 +404,7 @@
         </dependency>
         <dependency>
           <groupId>org.hamcrest</groupId>
-          <artifactId>hamcrest-core</artifactId>
+          <artifactId>hamcrest</artifactId>
           <scope>compile</scope>
         </dependency>
         <dependency>
diff --git a/hbase-asyncfs/pom.xml b/hbase-asyncfs/pom.xml
index dc46347eb1d..adea4a6898a 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 20bf7a4f20a..d4b817ca343 100644
--- a/hbase-client/pom.xml
+++ b/hbase-client/pom.xml
@@ -205,7 +205,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 8a6100405fa..1f02420af30 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -137,7 +137,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 a03930977ba..e2a83042443 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 f740a7cf2dd..5da7be1415f 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 c154f08be41..55bfbec3562 100644
--- a/hbase-compression/hbase-compression-lz4/pom.xml
+++ b/hbase-compression/hbase-compression-lz4/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-snappy/pom.xml 
b/hbase-compression/hbase-compression-snappy/pom.xml
index 2103f187e66..1d079e2c744 100644
--- a/hbase-compression/hbase-compression-snappy/pom.xml
+++ b/hbase-compression/hbase-compression-snappy/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-xz/pom.xml 
b/hbase-compression/hbase-compression-xz/pom.xml
index 80254ab7ea5..6ecb8a8182b 100644
--- a/hbase-compression/hbase-compression-xz/pom.xml
+++ b/hbase-compression/hbase-compression-xz/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 63ecde7646a..05a0fdbd029 100644
--- a/hbase-compression/hbase-compression-zstd/pom.xml
+++ b/hbase-compression/hbase-compression-zstd/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-endpoint/pom.xml b/hbase-endpoint/pom.xml
index da729213cb3..44e64cd27f6 100644
--- a/hbase-endpoint/pom.xml
+++ b/hbase-endpoint/pom.xml
@@ -217,7 +217,7 @@
     them manually. -->
     <dependency>
       <groupId>org.hamcrest</groupId>
-      <artifactId>hamcrest-library</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 bedce0b4701..8cbda23a09b 100644
--- a/hbase-http/pom.xml
+++ b/hbase-http/pom.xml
@@ -124,7 +124,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 b96e2420ab8..b4e968da57b 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 0a345dc3f0b..27453a848db 100644
--- a/hbase-mapreduce/pom.xml
+++ b/hbase-mapreduce/pom.xml
@@ -222,7 +222,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 7db366e8ebe..985b0bce480 100644
--- a/hbase-replication/pom.xml
+++ b/hbase-replication/pom.xml
@@ -115,7 +115,7 @@
     </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
-      <artifactId>hamcrest-core</artifactId>
+      <artifactId>hamcrest</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
diff --git a/hbase-resource-bundle/src/main/resources/supplemental-models.xml 
b/hbase-resource-bundle/src/main/resources/supplemental-models.xml
index f1008c02030..b07533be914 100644
--- a/hbase-resource-bundle/src/main/resources/supplemental-models.xml
+++ b/hbase-resource-bundle/src/main/resources/supplemental-models.xml
@@ -2446,4 +2446,17 @@ Copyright (c) 2007-2017 The JRuby project
       </licenses>
     </project>
   </supplement>
+  <supplement>
+    <project>
+      <groupId>org.hamcrest</groupId>
+      <artifactId>hamcrest</artifactId>
+      <licenses>
+        <license>
+          <name>BSD 3-Clause License</name>
+          <url>http://www.opensource.org/licenses/BSD-3-Clause</url>
+          <distribution>repo</distribution>
+        </license>
+      </licenses>
+    </project>
+  </supplement>
 </supplementalDataModels>
diff --git a/hbase-rest/pom.xml b/hbase-rest/pom.xml
index ad6a76458c1..b4de234429b 100644
--- a/hbase-rest/pom.xml
+++ b/hbase-rest/pom.xml
@@ -216,7 +216,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 eda694e7262..b92769ea2eb 100644
--- a/hbase-server/pom.xml
+++ b/hbase-server/pom.xml
@@ -256,7 +256,7 @@
     <!-- Test dependencies -->
     <dependency>
       <groupId>org.hamcrest</groupId>
-      <artifactId>hamcrest-core</artifactId>
+      <artifactId>hamcrest</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -269,11 +269,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.bouncycastle</groupId>
       <artifactId>bcprov-jdk18on</artifactId>
diff --git a/hbase-testing-util/pom.xml b/hbase-testing-util/pom.xml
index dafdda5822a..024a5f1ba15 100644
--- a/hbase-testing-util/pom.xml
+++ b/hbase-testing-util/pom.xml
@@ -150,7 +150,7 @@
     </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
-      <artifactId>hamcrest-library</artifactId>
+      <artifactId>hamcrest</artifactId>
       <scope>compile</scope>
     </dependency>
     <dependency>
diff --git a/hbase-zookeeper/pom.xml b/hbase-zookeeper/pom.xml
index a8e2cd3884e..ae12ea89cea 100644
--- a/hbase-zookeeper/pom.xml
+++ b/hbase-zookeeper/pom.xml
@@ -130,7 +130,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 45a7c2c79eb..9759a554f97 100644
--- a/pom.xml
+++ b/pom.xml
@@ -595,7 +595,7 @@
     <jruby.version>9.2.21.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>
@@ -1382,12 +1382,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>
@@ -2279,6 +2274,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>
@@ -2786,7 +2799,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 -->
@@ -2842,7 +2855,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 -->
@@ -2906,7 +2919,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 -->
@@ -2969,7 +2982,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 -->

Reply via email to