Skip to content

Commit 23f803c

Browse files
committed
Upgrade to Hamcrest 2.1, switch to hamcrest artifact from -core and -library
Closes gh-15555
1 parent f1dd973 commit 23f803c

File tree

12 files changed

+95
-22
lines changed

12 files changed

+95
-22
lines changed

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,12 @@
497497
<groupId>com.squareup.okhttp3</groupId>
498498
<artifactId>mockwebserver</artifactId>
499499
<scope>test</scope>
500+
<exclusions>
501+
<exclusion>
502+
<groupId>org.hamcrest</groupId>
503+
<artifactId>hamcrest-core</artifactId>
504+
</exclusion>
505+
</exclusions>
500506
</dependency>
501507
<dependency>
502508
<groupId>com.jayway.jsonpath</groupId>

Diff for: spring-boot-project/spring-boot-autoconfigure/pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,12 @@
855855
<groupId>com.squareup.okhttp3</groupId>
856856
<artifactId>mockwebserver</artifactId>
857857
<scope>test</scope>
858+
<exclusions>
859+
<exclusion>
860+
<groupId>org.hamcrest</groupId>
861+
<artifactId>hamcrest-core</artifactId>
862+
</exclusion>
863+
</exclusions>
858864
</dependency>
859865
<dependency>
860866
<groupId>com.sun.xml.messaging.saaj</groupId>

Diff for: spring-boot-project/spring-boot-cli/pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@
153153
<groupId>junit</groupId>
154154
<artifactId>junit</artifactId>
155155
<scope>test</scope>
156+
<exclusions>
157+
<exclusion>
158+
<groupId>org.hamcrest</groupId>
159+
<artifactId>hamcrest-core</artifactId>
160+
</exclusion>
161+
</exclusions>
156162
</dependency>
157163
</dependencies>
158164
<build>

Diff for: spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/install/GroovyGrabDependencyResolverTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ public void resolveShorthandArtifactWithDependencies() throws Exception {
121121
public void resolveMultipleArtifacts() throws Exception {
122122
List<File> resolved = this.resolver.resolve(Arrays.asList("junit:junit:4.11",
123123
"commons-logging:commons-logging:1.1.3"));
124-
assertThat(resolved).hasSize(3);
124+
assertThat(resolved).hasSize(4);
125125
assertThat(getNames(resolved)).containsOnly("junit-4.11.jar",
126-
"commons-logging-1.1.3.jar", "hamcrest-core-1.3.jar");
126+
"commons-logging-1.1.3.jar", "hamcrest-core-2.1.jar", "hamcrest-2.1.jar");
127127
}
128128

129129
public Set<String> getNames(Collection<File> files) {

Diff for: spring-boot-project/spring-boot-dependencies/pom.xml

+6-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<groovy.version>2.5.7</groovy.version>
6767
<gson.version>2.8.5</gson.version>
6868
<h2.version>1.4.199</h2.version>
69-
<hamcrest.version>1.3</hamcrest.version>
69+
<hamcrest.version>2.1</hamcrest.version>
7070
<hazelcast.version>3.12</hazelcast.version>
7171
<hazelcast-hibernate5.version>1.3.2</hazelcast-hibernate5.version>
7272
<hibernate.version>5.4.2.Final</hibernate.version>
@@ -2245,6 +2245,11 @@
22452245
<scope>import</scope>
22462246
<type>pom</type>
22472247
</dependency>
2248+
<dependency>
2249+
<groupId>org.hamcrest</groupId>
2250+
<artifactId>hamcrest</artifactId>
2251+
<version>${hamcrest.version}</version>
2252+
</dependency>
22482253
<dependency>
22492254
<groupId>org.hamcrest</groupId>
22502255
<artifactId>hamcrest-core</artifactId>

Diff for: spring-boot-project/spring-boot-docs/pom.xml

+15-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@
8888
<groupId>javax.activation</groupId>
8989
<artifactId>activation</artifactId>
9090
</exclusion>
91+
<exclusion>
92+
<groupId>org.hamcrest</groupId>
93+
<artifactId>hamcrest-core</artifactId>
94+
</exclusion>
95+
<exclusion>
96+
<groupId>org.hamcrest</groupId>
97+
<artifactId>hamcrest-library</artifactId>
98+
</exclusion>
9199
</exclusions>
92100
</dependency>
93101
<dependency>
@@ -401,6 +409,12 @@
401409
<groupId>junit</groupId>
402410
<artifactId>junit</artifactId>
403411
<optional>true</optional>
412+
<exclusions>
413+
<exclusion>
414+
<groupId>org.hamcrest</groupId>
415+
<artifactId>hamcrest-core</artifactId>
416+
</exclusion>
417+
</exclusions>
404418
</dependency>
405419
<dependency>
406420
<groupId>org.junit.jupiter</groupId>
@@ -660,7 +674,7 @@
660674
</dependency>
661675
<dependency>
662676
<groupId>org.hamcrest</groupId>
663-
<artifactId>hamcrest-library</artifactId>
677+
<artifactId>hamcrest</artifactId>
664678
<optional>true</optional>
665679
</dependency>
666680
<dependency>

Diff for: spring-boot-project/spring-boot-parent/pom.xml

+8-1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@
246246
<groupId>org.junit.vintage</groupId>
247247
<artifactId>junit-vintage-engine</artifactId>
248248
<scope>test</scope>
249+
<exclusions>
250+
<exclusion>
251+
<groupId>org.hamcrest</groupId>
252+
<artifactId>hamcrest-core</artifactId>
253+
</exclusion>
254+
</exclusions>
249255
</dependency>
250256
<dependency>
251257
<groupId>org.mockito</groupId>
@@ -264,7 +270,7 @@
264270
</dependency>
265271
<dependency>
266272
<groupId>org.hamcrest</groupId>
267-
<artifactId>hamcrest-library</artifactId>
273+
<artifactId>hamcrest</artifactId>
268274
<scope>test</scope>
269275
</dependency>
270276
<dependency>
@@ -583,6 +589,7 @@
583589
<bannedDependencies>
584590
<excludes>
585591
<exclude>com.zaxxer:HikariCP-*</exclude>
592+
<exclude>org.hamcrest:hamcrest-*</exclude>
586593
<exclude>javax.*:*:*</exclude>
587594
</excludes>
588595
<includes>

Diff for: spring-boot-project/spring-boot-starters/spring-boot-starter-test/pom.xml

+13-5
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,22 @@
4242
<dependency>
4343
<groupId>org.junit.vintage</groupId>
4444
<artifactId>junit-vintage-engine</artifactId>
45+
<exclusions>
46+
<exclusion>
47+
<groupId>org.hamcrest</groupId>
48+
<artifactId>hamcrest-core</artifactId>
49+
</exclusion>
50+
</exclusions>
4551
</dependency>
4652
<dependency>
4753
<groupId>junit</groupId>
4854
<artifactId>junit</artifactId>
55+
<exclusions>
56+
<exclusion>
57+
<groupId>org.hamcrest</groupId>
58+
<artifactId>hamcrest-core</artifactId>
59+
</exclusion>
60+
</exclusions>
4961
</dependency>
5062
<dependency>
5163
<groupId>org.mockito</groupId>
@@ -57,11 +69,7 @@
5769
</dependency>
5870
<dependency>
5971
<groupId>org.hamcrest</groupId>
60-
<artifactId>hamcrest-core</artifactId>
61-
</dependency>
62-
<dependency>
63-
<groupId>org.hamcrest</groupId>
64-
<artifactId>hamcrest-library</artifactId>
72+
<artifactId>hamcrest</artifactId>
6573
</dependency>
6674
<dependency>
6775
<groupId>org.mockito</groupId>

Diff for: spring-boot-project/spring-boot-test-autoconfigure/pom.xml

+12
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@
5353
<groupId>javax.activation</groupId>
5454
<artifactId>activation</artifactId>
5555
</exclusion>
56+
<exclusion>
57+
<groupId>org.hamcrest</groupId>
58+
<artifactId>hamcrest-core</artifactId>
59+
</exclusion>
60+
<exclusion>
61+
<groupId>org.hamcrest</groupId>
62+
<artifactId>hamcrest-library</artifactId>
63+
</exclusion>
5664
</exclusions>
5765
</dependency>
5866
<dependency>
@@ -367,6 +375,10 @@
367375
<groupId>javax.xml.bind</groupId>
368376
<artifactId>jaxb-api</artifactId>
369377
</exclusion>
378+
<exclusion>
379+
<groupId>org.hamcrest</groupId>
380+
<artifactId>hamcrest-core</artifactId>
381+
</exclusion>
370382
</exclusions>
371383
</dependency>
372384
</dependencies>

Diff for: spring-boot-project/spring-boot-test/pom.xml

+7-6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
<groupId>junit</groupId>
5555
<artifactId>junit</artifactId>
5656
<optional>true</optional>
57+
<exclusions>
58+
<exclusion>
59+
<groupId>org.hamcrest</groupId>
60+
<artifactId>hamcrest-core</artifactId>
61+
</exclusion>
62+
</exclusions>
5763
</dependency>
5864
<dependency>
5965
<groupId>org.apache.httpcomponents</groupId>
@@ -67,12 +73,7 @@
6773
</dependency>
6874
<dependency>
6975
<groupId>org.hamcrest</groupId>
70-
<artifactId>hamcrest-core</artifactId>
71-
<optional>true</optional>
72-
</dependency>
73-
<dependency>
74-
<groupId>org.hamcrest</groupId>
75-
<artifactId>hamcrest-library</artifactId>
76+
<artifactId>hamcrest</artifactId>
7677
<optional>true</optional>
7778
</dependency>
7879
<dependency>

Diff for: spring-boot-project/spring-boot-tools/spring-boot-test-support/pom.xml

+7-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@
4949
</dependency>
5050
<dependency>
5151
<groupId>org.hamcrest</groupId>
52-
<artifactId>hamcrest-core</artifactId>
53-
</dependency>
54-
<dependency>
55-
<groupId>org.hamcrest</groupId>
56-
<artifactId>hamcrest-library</artifactId>
52+
<artifactId>hamcrest</artifactId>
5753
</dependency>
5854
<dependency>
5955
<groupId>org.assertj</groupId>
@@ -118,6 +114,12 @@
118114
<groupId>junit</groupId>
119115
<artifactId>junit</artifactId>
120116
<scope>provided</scope>
117+
<exclusions>
118+
<exclusion>
119+
<groupId>org.hamcrest</groupId>
120+
<artifactId>hamcrest-core</artifactId>
121+
</exclusion>
122+
</exclusions>
121123
</dependency>
122124
<!-- Test -->
123125
<dependency>

Diff for: spring-boot-project/spring-boot/pom.xml

+7-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@
115115
<groupId>junit</groupId>
116116
<artifactId>junit</artifactId>
117117
<optional>true</optional>
118+
<exclusions>
119+
<exclusion>
120+
<groupId>org.hamcrest</groupId>
121+
<artifactId>hamcrest-core</artifactId>
122+
</exclusion>
123+
</exclusions>
118124
</dependency>
119125
<dependency>
120126
<groupId>org.apache.commons</groupId>
@@ -210,7 +216,7 @@
210216
</dependency>
211217
<dependency>
212218
<groupId>org.hamcrest</groupId>
213-
<artifactId>hamcrest-library</artifactId>
219+
<artifactId>hamcrest</artifactId>
214220
<optional>true</optional>
215221
</dependency>
216222
<dependency>

0 commit comments

Comments
 (0)