gradle-bundle-plugin icon indicating copy to clipboard operation
gradle-bundle-plugin copied to clipboard

Unit Tests - No OSGi SCR metadata found (missing OSGI-INF in output folder)

Open Rpaixao opened this issue 8 years ago • 1 comments

Hello,

I am using your plugin and it works very well when I deploy the generated bundles in my application. However, I'm having problems in unit tests environment.

I am trying to run a unit tests and I'm getting the following Error " No OSGi SCR metadata found for class ..." .

After some research I realized that this error is happening because (unlike in the jar file) there is no OSGI-INF folder with the OSGI SRC Metadata in gradle output folder (see image bellow).

captura de ecra 2017-12-14 as 10 59 58

(I generated the missing folder manually, and the tests run like a charm)

Would you please assist me by understanding this situation?

Thanks!

Rpaixao avatar Dec 14 '17 10:12 Rpaixao

Hi,

You can resolve this issue by adding the following to your gradle configurations.

// Depend on jar task that runs BND to get OSGi metadata test.dependsOn jar // Add jar to classpath to find OSGi metadata test.classpath += files(jar.archivePath)

realPyR3X avatar Aug 22 '18 19:08 realPyR3X