renatoathaydes / osgi-run

Osgi-Run - A Gradle plugin to make the development of modular applications using OSGi completely painless
Apache License 2.0
54 stars 13 forks source link

Getting a 'Cannot read Declarative Services declarations from null' error #69

Closed npeleg closed 3 years ago

npeleg commented 3 years ago

Environment:

Running gradlew.bat build, and getting the following error: Execution failed for task ':example:jar'.

Cannot read Declarative Services declarations from null

Would appreciate any help in understanding this. (BTW, my goal is to make my jar an OSGI bundle. The native gradle osgi plugin was removed, so I wanted to use your plugin instead. If your plugin is not a substitute for the native plugin, can you please let me know which plugin would be relevant?).

Thanks!

renatoathaydes commented 3 years ago

This plugin cannot turn your jar into a bundle, as explained in the README. Use gradle-bundle-plugin to do that, then osgi-run to put all your bundles into an OSGi container and run it.

Does this answer your question?

npeleg commented 3 years ago

Thanks for your answer. It seems that gradle-bundle-plugin is not compatible with Gradle 6, and looking at other options it seems that there are no such plugins (If you come across one I'll be happy to hear).

Thank you!

renatoathaydes commented 3 years ago

If your main concern is to use OSGi rather than use Gradle, just downgrade to Gradle 5 or whatever is needed to use that plugin?

Also, maybe create a ticket for the maintainer of that plugin to upgrade to newer Gradle versions, they might be able to get it upgraded quickly.

renatoathaydes commented 3 years ago

@npeleg if you missed this one (I mention it in the README as well), it seems to be upgraded to Gradle 5.x and 6.x: https://github.com/bndtools/bnd/tree/master/biz.aQute.bnd.gradle

And this is from the BND tools team, which is highly regarded in the OSGi world.