0

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

djb
  • 1,635
  • 3
  • 26
  • 49
  • I don't see why you need to define the Import-Package exclusion rule. If they are generated inside your project, they are not being imported. Add your POM to the question, at least the build section, to be easier to asses the issue. – Marcos Zolnowski Mar 21 '19 at 19:35
  • 1
    So my generated files are not being included in the jar bundle, for some reason. That's the main oddity. (The import-package thing is maybe a red herring). Will have another look tomorrow. Thanks – djb Mar 21 '19 at 21:08
  • 1
    So, I deleted the section, and that fixed it :/ – djb Mar 25 '19 at 10:52

1 Answers1

0

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.

djb
  • 1,635
  • 3
  • 26
  • 49