Community
Participate
Working Groups
Eclipse 3.7 M5 I have a unit test that uses hamcrest and and the dependency is declared with import package on the pakcage org.hamcrest;version="1.1.0" The code fails to compile with the error message The import org.hamcrest cannot be found. To reproduce, you can extract the code from the mongo-emf project https://github.com/BryanHunt/mongo-emf Change the org.eclipselabs.mongo.junit mainfest by removing the bundle dependency on org.hamcrest.core and add the include package org.hamcrest.
Can you attach the required projects (to reproduce the problem) here. I don't have EGit in my eclipse instances.
Created attachment 188557 [details] source projects Here are the source projects. org.eclipselabs.mongo.junit should not build due to the problem described. You will need the target platform as described on the project page: http://code.google.com/a/eclipselabs.org/p/mongo-emf/ You do not need the mongo_emf.zip bundles in your target platform to reproduce this problem.
Additional info: If you add both the org.hamcrest and org.hamcrest.core as imported packages, the error message changes to: Access restriction: The method is(Matcher<Object>) from the type CoreMatchers is not accessible due to restriction on required library /Users/bhunt/Documents/Programming/Code/Targets/Eclipse SDK 3.7M5/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar If you add the org.hamcrest.core bundle to the list of Automated Management of Dependencies, the compile errors will be fixed, but the unit test will not run. You get the following errors: !ENTRY org.eclipse.osgi 2 0 2011-02-21 18:33:03.564 !MESSAGE One or more bundles are not resolved because the following root constraints are not resolved: !SUBENTRY 1 org.eclipse.osgi 2 0 2011-02-21 18:33:03.564 !MESSAGE Bundle initial@reference:file:../../Workspaces/EclipseLabs/mongo-emf/mongo-emf/tests/org.eclipselabs.mongo.junit/ was not resolved. !SUBENTRY 2 org.eclipselabs.mongo.junit 2 0 2011-02-21 18:33:03.564 !MESSAGE Missing imported package org.hamcrest_1.1.0.
I think your issue may be related to bug 334540. Just ran into this myself...
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.