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

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


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

commit 10c8bd7e39f9e6482616ada5c2ecd6051af30f34
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-backup/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-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 b9915b61333..40f21a7adc5 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 4fe6870fa97..80fa5596abc 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-backup/pom.xml b/hbase-backup/pom.xml
index 61f7ac09101..8e188748f51 100644
--- a/hbase-backup/pom.xml
+++ b/hbase-backup/pom.xml
@@ -179,7 +179,7 @@
     </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
-      <artifactId>hamcrest-library</artifactId>
+      <artifactId>hamcrest</artifactId>
       <scope>test</scope>
     </dependency>
   </dependencies>
diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml
index e54ca13d63c..7138552e4f4 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 f89cadf308b..578fd6402b0 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 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 5a1b9b4aff5..5d2352149ff 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 48c03fd5896..6dc2c09e4c2 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-zstd/pom.xml 
b/hbase-compression/hbase-compression-zstd/pom.xml
index b3ae7bd8812..ed2d462726b 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 60d2a421b54..86f38c007ff 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 9ebe3946800..98cd5f65571 100644
--- a/hbase-http/pom.xml
+++ b/hbase-http/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-it/pom.xml b/hbase-it/pom.xml
index b84ebb6af5d..d6238e2cec6 100644
--- a/hbase-it/pom.xml
+++ b/hbase-it/pom.xml
@@ -207,12 +207,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 83de8419969..bfddfbc8f8a 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 21c14270c3e..7bebd603421 100644
--- a/hbase-replication/pom.xml
+++ b/hbase-replication/pom.xml
@@ -121,7 +121,7 @@
     </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
-      <artifactId>hamcrest-library</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 20bec9d8195..95f12118151 100644
--- a/hbase-resource-bundle/src/main/resources/supplemental-models.xml
+++ b/hbase-resource-bundle/src/main/resources/supplemental-models.xml
@@ -2428,4 +2428,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 d1f33618692..f11e84b0715 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 723d1da788d..0eda79a9a44 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.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
diff --git a/hbase-testing-util/pom.xml b/hbase-testing-util/pom.xml
index 0808ebebf07..fbdaa92ec11 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 1bac78e2202..ebc1685f830 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 29645023187..874c4d5f051 100644
--- a/pom.xml
+++ b/pom.xml
@@ -597,7 +597,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>
@@ -1388,12 +1388,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>
@@ -2285,6 +2280,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>
@@ -2806,7 +2819,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 -->
@@ -2862,7 +2875,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 -->
@@ -2926,7 +2939,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 -->
@@ -2989,7 +3002,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