Skip to content

[MSHARED-1255] use dependencyManagement to set hamcrest-core version - #143

Merged
elharo merged 1 commit into
masterfrom
bom
May 19, 2023
Merged

elharo merged 1 commit into
masterfrom
bom

Conversation

@elharo

@elharo elharo commented May 16, 2023 •

Copy link
Copy Markdown
Contributor

Removes dependency warning but still selects the right version of hamcrest-core in transitive dependencies. See https://hamcrest.org/JavaHamcrest/distributables

@elharo elharo changed the title use dependencyManagement [MSHARED-1255] use dependencyManagement to set hamcrest-core version May 19, 2023
@elharo
elharo marked this pull request as ready for review May 19, 2023 13:33
@elharo
elharo requested a review from michael-o May 19, 2023 13:33
@michael-o

Copy link
Copy Markdown
Member

I don't understand this. If a direct dep uses the wrong version then there is the place to fix? Or do we have a conflict in trans deps here?

@elharo

elharo commented May 19, 2023

Copy link
Copy Markdown
Contributor Author

See https://hamcrest.org/JavaHamcrest/distributables for the detailed explanation.

This is a weird case that crops up when using JUnit 4 with Hamcrest 2 because Hamcrest moved classes around between artifacts in version 2. Without this JUnit 4 will pull hamcrest-core 1.4.x into the tree, which contains some of the same classes as org.hamcrest:hamcrest:2.2. This can cause split package issues. In 2.2 hamcrest-core is an empty jar to override this.

@michael-o michael-o left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your explanation is reasonable.

@elharo
elharo merged commit 0f3ee16 into master May 19, 2023
@elharo
elharo deleted the bom branch May 19, 2023 17:27
@slachiewicz slachiewicz added this to the 3.5.0 milestone Feb 1, 2026
@slachiewicz slachiewicz added dependencies Pull requests that update a dependency file and removed maintenance labels Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants