added a comment - - edited
This is actually only a problem if the resource is a Java ARchive that shall get embedded into the OSGi bundle. Simple resources can just be added to the production resources source set and will be automatically added to the OSGi bundle from there.
For JAR resources two things have to happen to get this working.
- Copy the JAR resources under the classesDir, e.g. classesDir/lib/my-resource.jar
- Add the previously copied JAR resources to the Bundle-ClassPath instruction, e.g. .,lib/my-resource.jar
In order to separate the embedded JARs from the provided once I'm proposing the addition of two more configurations to the OSGi Plugin:
- embeddedRuntime extends embeddedCompile
My understanding is that the runtime configuration should not be extended by embeddedRuntime, only compile should be extended by embeddedCompile as the associated artifacts are embedded and only available via the bundle classpath.
If interested, I can provide the code for this change. Also note that AFAIK this change will require the OSGi plugin to directly apply the Java plugin.