Spring boot starter test includes a dependency on org.hamcrest:hamcrest-library:2.2 that has moved GAV and replaced by org.hamcrest:hamcrest:3.

Code: https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-test/build.gradle#L25

See https://hamcrest.org/JavaHamcrest/distributables#previous-versions-of-hamcrest and https://central.sonatype.com/artifact/org.hamcrest/hamcrest/versions

[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:3.3.3:test
[INFO] |  \- org.hamcrest:hamcrest:jar:2.2:test (version managed from 2.2)
[INFO] +- **org.hamcrest:hamcrest-library:jar:2.2:test**

This maven command checks and fails: mvn biz.lermitage.oga:oga-maven-plugin:check

error output:

[ERROR] (dependency) 'org.hamcrest:hamcrest-library' should be replaced by 'org.hamcrest:hamcrest' 
(context: The library of Matcher implementations which are based on
the core functionality in hamcrest-core.jar. From Hamcrest version 2.x, all the classes in
hamcrest-core.jar were moved into hamcrest.jar. See
https://hamcrest.org/JavaHamcrest/distributables#previous-versions-of-hamcrest)
[ERROR] Project has old dependencies; see warning/error messages

Comment From: wilkinsona

The dependency in spring-boot-test is optional and doesn't appear in the project's pom. Your project's dependency on hamcrest-library must be coming from elsewhere. spring-boot-starter-test already depends on org.hamcrete:hamcrest, as shown by the dependency tree you've shared above:

[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:3.3.3:test
[INFO] |  \- org.hamcrest:hamcrest:jar:2.2:test (version managed from 2.2)

If you would like us to investigate further, please share a minimal Maven project that shows the hamcrest-library dependency being pulled in transitively by a Spring Boot module.

Comment From: chas678

ok! thankyou, you are right. will resolve the other source. please close.