Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple JUnit from Hamcrest #1145

Open
marcphilipp opened this issue May 22, 2015 · 4 comments
Open

Decouple JUnit from Hamcrest #1145

marcphilipp opened this issue May 22, 2015 · 4 comments
Labels

Comments

@marcphilipp
Copy link
Member

@npryce has nicely summed up the reasons to do this in his blog:
http://www.natpryce.com/articles/000806.html

@marcphilipp marcphilipp added this to the 5.0 milestone May 22, 2015
marcphilipp added a commit to marcphilipp/junit that referenced this issue May 22, 2015
Use hamcrest-junit 2.0.0.0 instead

Fixes junit-team#1145
marcphilipp added a commit to marcphilipp/junit that referenced this issue May 22, 2015
Use hamcrest-junit 2.0.0.0 instead

Fixes junit-team#1145
@kcooney
Copy link
Member

kcooney commented May 23, 2015

Sounds like a good plan. Let's deprecate the APIs that use Matcher on the main branch

@Tibor17
Copy link
Contributor

Tibor17 commented May 30, 2015

What about to declare optional dependency of Hamcrest in POM:4.13?
Looks like some API are deprecated and you would force the users include their dependency of Hamcrest.

This means our POM would specify optional dependency:
<dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-core</artifactId> <version>1.3</version> <optional>true</optional> </dependency>
and customer does not receive Hamcrest in his classpath. Therefore the customer will specify it in his POM with the version he likes.

@marcphilipp marcphilipp removed this from the 5.0 milestone May 2, 2016
@drjasonharrison
Copy link

Will this also resolve the warning that com.netflix.nebula.lint produces:

warning   duplicate-dependency-class         junit:junit:4.12 in configuration ':moduleA:compile' has 21 classes duplicated by org.hamcrest:hamcrest-core:1.3 (use --debug for detailed class list) (no auto-fix available)

nebula-plugins/gradle-lint-plugin#103

@kcooney
Copy link
Member

kcooney commented Mar 27, 2017

@drjasonharrison I don't think that should happen with JUnit 4.12 (it doesn't ship with Hamcrest classes). Is it possible you depend on multiple versions of JUnit?

In any case, I suggest trying to create a minimal reproducible test case and ask on stackoverflow.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants