1

Code is working fine in Eclipse Oxygen 3, but the same code showing error in Eclipse Photon.

Error : The type org.hamcrest.Matcher cannot be resolved. It is indirectly referenced from required .class files

pom.xml : Dependencies for hamcrest

<dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <artifactId>hamcrest-core</artifactId>
                <groupId>org.hamcrest</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>

Anyone has any idea about how can i remove this error?

patidarsnju
  • 439
  • 5
  • 10

1 Answers1

-2

Place the hamcrest-all jar from below in your build path, this worked for me.

https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all/1.3