Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Rpaixao opened this issue Dec 14, 2017 · 1 comment

Comments

@Rpaixao
Copy link

Rpaixao commented Dec 14, 2017

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!

@realPyR3X
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants