Skip to content

Commit

Permalink
TRUNK-5982 Adapt to new hamcrest packaging
Browse files Browse the repository at this point in the history
hamcrest as of 2.x ships what was previously in hamcrest-core and
hamcrest-library in a single jar at artifact coordinate
org.hamcrest:hamcrest

So as of 2.x you only need to depend on the org.hamcrest:hamcrest.
Since JUnit 4 depends on hamcrest-core we need to follow these steps
http://hamcrest.org/JavaHamcrest/distributables#upgrading-from-hamcrest-1x
hamcrest/JavaHamcrest#224 (comment)

to make sure also hamcrest-core is updated. The dependency on
hamcrest-core can be removed once JUnit 4 support is dropped.
  • Loading branch information
teleivo authored and devmalik7 committed Jan 21, 2021
1 parent 0809a6d commit e39c425
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion liquibase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<artifactId>hamcrest</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
12 changes: 9 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,20 @@
<artifactId>powermock-api-mockito2</artifactId>
<version>2.0.9</version>
</dependency>
<!--hamcrest-core is needed to update JUnit 4 transitive dependency on hamcrest-core as explained in
http://hamcrest.org/JavaHamcrest/distributables#upgrading-from-hamcrest-1x and
https://github.com/hamcrest/JavaHamcrest/issues/224#issuecomment-449760045
Once we remove JUnit 4 we will only need org.hamcrest:hamcrest
-->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>2.2</version>
<version>${hamcrestVersion}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>2.2</version>
<artifactId>hamcrest</artifactId>
<version>${hamcrestVersion}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
Expand Down Expand Up @@ -1151,6 +1156,7 @@
<jacksonVersion>2.12.0</jacksonVersion>
<junitVersion>5.7.0</junitVersion>
<mockitoVersion>3.6.28</mockitoVersion>
<hamcrestVersion>2.2</hamcrestVersion>

<slf4jVersion> 1.7.30</slf4jVersion>
<log4jVersion>2.14.0</log4jVersion>
Expand Down
21 changes: 13 additions & 8 deletions test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,19 @@
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
</dependency>
<!--hamcrest-core is needed to update JUnit 4 transitive dependency on hamcrest-core as explained in
http://hamcrest.org/JavaHamcrest/distributables#upgrading-from-hamcrest-1x and
https://github.com/hamcrest/JavaHamcrest/issues/224#issuecomment-449760045
Once we remove JUnit 4 we will only need org.hamcrest:hamcrest
-->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
</dependency>
</dependencies>

<build>
Expand Down

0 comments on commit e39c425

Please sign in to comment.