To use xmlbeans generated code you need access to the SchemaTypeSystemImpl, which is not imported by the maven-bundle-plugin. So you need to add something like this to the pom:
Also, any package we may have with "impl" or "internal" needs to be explicitly listed in the Export-Packages.
Many problems with building plugins are caused by non-bundle dependencies getting installed in felix rather than bundleized equivalents. Unfortuneately it looks like felix only says "non-framework bundles cannot be started" without telling us the location of the non-bundle. Running
helps to find the bad dependencies. On a related note, generally you have to exclude original jars from the dependencyManagement dependency entry of a bundleized repackaging. This seems like a serious defect in maven-bundle-plugin.
I think it's a good idea to assemble a server for each set of plugins to make sure they at least start. Here's how:
where <foo> is your set of plugins
and a profile
Note that at the moment the -Pit doesn't actually work, you have to try to start the server by hand
Frequently, you'll see build problems with attempting to load a class when starting a configuration. Most of the time, this is caused by a bundle resolution problem that occurs earlier, but the information has been swallowed. If you use the -X option on the build, the resolution error will be given earlier in the build and you can generally figure out what's missing from that.
Occasionally, the resolution error will be a very generic "Constraint violation" without much information on what actually failed. Turning on debug logging in Felix will give some information, but I've found that building Felix with the following patch applied helps diagnose the problem more quickly:
When converting plugins make sure to avoid the following dependencies: log4j, jcl-over-slf4j,
jul-to-slf4j, slf4j-api, or slf4j-log4j12. Instead use pax-logging-api. This bundle exports all of these logging API.
The pax-logging-api together with pax-logging-service provides a logging service in the OSGi environment that works with all commonly used logging API.