Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Hamcrest conflict with JUnit runner - signed/unsigned jars(older OSGI signed hamcrest jar conflicts with unsigned project classpath jar)
Hamcrest conflict with JUnit runner - signed/unsigned jars [message #1125633] Fri, 04 October 2013 18:26
David Biesack is currently offline David BiesackFriend
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
Previous Topic:Referring to fonts in Java on openSUSE 12.3
Next Topic:Java int[] Array [I@24a1a602]
Goto Forum:
  


Current Time: Wed Apr 24 23:32:00 GMT 2024

Powered by FUDForum. Page generated in 0.02634 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top