Providing external bundle as a Maven dependency when unit testing


I want to execute tests in a bundle A and those tests need bundle B to be deployed.

Bundle B is provided as a dependency by an in-house Nexus server, and declared as a dependency with the scope “test” in bundle A pom.

Then I want to deploy bundle A using RuntimeFeature:

@Features({ CoreFeature.class, RuntimeFeature.class  })
@Deploy({ "org.nuxeo.ecm.automation.core", "org.nuxeo.ecm.core.schema", ""})
public class MakeLinkBeanTest {

    CoreSession session;

    private DocumentModel doc;

    public void testDoGet() throws Exception {
      doc = session.createDocumentModel("/", "test", "Thesis"); // <- defined in bundle B

But this does not work. What I get is:

[NXRuntimeTestCase] No bundle with symbolic name ''; Falling back to deprecated url lookup scheme
[RuntimeFeature] Unable to deploy artifact:

One solution is to bundle everything together, but this has led me to ask myself: what's wrong with this ?


0 votes

1 answers



If the bundle B (which I suppose is is not found, that means that it's not in your classpath.

To put it in the classpath, you should add the maven module containing it to your dependencies in your pom.xml and run a

mvn eclipse:eclipse

in your module. Then refresh you project in eclipse, check that the bundle is in the “Referenced Libraries”, then it should work.

0 votes

That's right, I forgot the mvn eclipse part of the process, thank you !