Skip to content

Is Hamcrest a dependency? #582

Description

@4r73m190r0s

I had all my tests fail, until I added Hamcrest as project dependency inside POM.xml. Should this be added inside POM.xml, or somehow I got test errors only on my side?

Activity

  1. github-actions commented on Nov 14, 2025

    @github-actions

    Hi 4r73m190r0s, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

    Suggestions

    • JUnit 4.11+ no longer bundles Hamcrest matchers; if you’re using JUnit 4.11 or later you must add Hamcrest explicitly in your POM:
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>1.3</version>        <!-- or newer, e.g. 2.2 -->
        <scope>test</scope>
      </dependency>
    • Verify your Maven Surefire plugin is picking up test-scope dependencies (default behavior).
    • If you prefer a single artifact, use the aggregated Hamcrest bundle:
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest</artifactId>
        <version>2.2</version>
        <scope>test</scope>
      </dependency>
    Other references with low confidence

    The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions