javamavenosgibndmaven-bundle-plugin

Embedding/Including generated sources with maven-bundle-plugin


I'm using OSGi (Fuse 7 / Karaf 4)

I was previously generating WSDL classes in my shared libs, and exporting them to service layer.

I'm trying to shift now to exporting the WSDL itself, and generating classes at the service layer.

The service classes and blueprint use the generated classes.
But I need to use a ! in the Import-Package, so BND doesn't try to import them.

I want it to find these generated classes, which Maven builds, into target/generated/src/main/java.

But if I look in the bundle jar, these CXF-generated classes aren't included.

How do I get BND to include the sources in this folder?

At the moment, I'm getting the error:

    Caused by: java.lang.ClassNotFoundException: com.company.ObjectFactory not found by Service [374]

And fair enough, because it's not in the jar. But the sources are under /target/generated, and it all compiles fine.

Things I've tried:

Embed-Directory

Include-Resource

build-helper-maven-plugin


Solution

  • So, it doesn't make much sense to me, but, I removed my section and this caused the wsdl-generated source files to be included in the bundle.