Hamcrest conflict with JUnit runner - signed/unsigned jars [message #1125633] |
Fri, 04 October 2013 18:26 |
David Biesack Messages: 9 Registered: July 2009 |
Junior Member |
|
|
I'm getting an error running JUnit 4 tests in Eclipse:
java.lang.SecurityException: class "org.hamcrest.TypeSafeMatcher"'s signer information does not match signer information of other classes in the same package
This was discussed on Hamcrest issue 128
It seems that Eclipse' use of the internal JUnit and Hamcrest 1.1 jars, which are signed OSGI bundles, conflicts with projects which use Hamcrest.
That issue suggests moving the Hamcrest jars before Junit in the project's libraries. However, I'm using Maven (m2e) and even though my pom.xml lists Hamcrest before Junit,
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
I still get this error when I run the unit tests in Eclipse. Running 'mvn test' outside of Eclipse runs without error because Maven only resolves to the 1.3 jars which are not signed.
Any fixes?
I'm running Spring Tool Suite (STS):
Version: 3.3.0.RELEASE
Build Id: 201307092139
|
|
|
Powered by
FUDForum. Page generated in 0.02803 seconds