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

java-hamcrest vs. hamcrest-core, hamcrest-library #183

Closed
Jeff-Walker opened this issue Aug 23, 2017 · 7 comments
Closed

java-hamcrest vs. hamcrest-core, hamcrest-library #183

Jeff-Walker opened this issue Aug 23, 2017 · 7 comments
Assignees

Comments

@Jeff-Walker
Copy link

Maybe I'm missing something, but I'm looking for the latest version of hamcrest. In the past I've always used hamcrest-core, etc. and the latest version is 1.3 from 2012. Now it seems there is java-hamcrest version 2.0 that's newer. Spring boot starter has hamcrest 1.3, but java-hamcrest has things I want. I can exclude/include the libraries in my POM, but it's very confusing.

I don't see anything in the docs or the GitHub project pages that indicates the name change. Moreover, when I click on the Maven central link it takes me to the search for "org.hamcrest" which includes both.

After some digging I've decided that I want java-hamcrest, but as a longtime users, it took me a while to figure this out.

@StevenGBrown
Copy link

Do I want hamcrest-junit or java-hamcrest? Maybe both? I agree that some documentation would be very useful. 👍

@sf105 sf105 self-assigned this Aug 10, 2018
@sf105
Copy link
Member

sf105 commented Aug 10, 2018

good point. It was a work in progress.

@Thunderforge
Copy link

Thunderforge commented Aug 21, 2018

@sf105 So what will actually be done to resolve this? Do we change documentation? Do we add a release to the GitHub releases tab? How will we resolve this issue of people not knowing what to download?

A casual user will look at the releases page and conclude that Hamcrest is dead because it hasn't been updated in 6 years (indeed, projects are already concluding this). If there is a newer version that people should be using, that isn't being communicated right now.

@garretwilson
Copy link

Yes, can someone explain this? All our code is using hamcrest-library, and I'm teaching that in the course I've written and given for a few years. Now on Baeldung: Hamcrest Text Matchers I see a reference to java-hamcrest, and I have no idea what it is. Does it replace hamcrest-library? Does it have everything that hamcrest-library does? Is it newer/better? Specifically I'm wanting the matchesPattern(…) Baeldung mentions. Is this a new addition?

At the least I just need something telling me what java-hamcrest is and its relation to hamcrest-library. Where can I find that?

Thank you kindly in advance.

@garretwilson
Copy link

P.S. If the "official page" that tells what's going on is continually delayed until "tomorrow", could someone at least provide an informal answer here in this ticket? That would be better than nothing. After all, this ticket is already coming up in searches for people (like me) wondering what the story is.

@sf105
Copy link
Member

sf105 commented Nov 22, 2018

java-hamcrest was a failed attempt at a new packaging. I think the best answer would be to look at hamcrest-all for future reference. @tumbarumba should be able to provide a more up-to-date answer.

@tumbarumba
Copy link
Member

For the currently version of Hamcrest (1.3), I've recently updated the instructions on the Hamcrest Distributables page. As a side-note, I do mention the 2.0.0.0 version at the bottom of that page (and recommend people don't use it)

However... I'm in the middle of preparing a new release of Hamcrest (issue #224). Here's what I'm thinking about at the moment:

  • Although there is no incompatible API changes (as per semantic versioning, the aborted 2.0.0.0 release is confusing, and I think we need to do a minor version increment above that, so I'm proposing the next version be 2.1.
  • We are going to repackage the old jars hamcrest-core and hamcrest-library, and merge them into a single hamcrest jar in the next version (we don't think the distinction between the two libraries was useful)
  • I'm currently thinking that hamcrest-integration isn't well used, and I'm not planning to release a new version (the 1.3 versions will of course remain in Maven Central). I'm not planning to release a version of hamcrest-all, either (which was a combination of hamcrest-core, hamcrest-library and hamcrest-integration. Hamcrest becomes just a single jar called hamcrest, which is a much less confusing story to tell.

@garretwilson: yes, matchesPattern is a new text matcher. PR #36 added a regular expression matcher, which was then included in the 2.0.0.0 release. However, because there was no release notice or documentation updates, people are confused (as described in this issue). When we do the release, I'll ask the Baeldung folks to update their tutorials, too.

As this issue is being addressed in the next release of Hamcrest (issue #224), I'm going to close this issue, and ask that further comments be put onto the #224 issue.

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

No branches or pull requests

6 participants