You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Lets collect tips on osgi conversion here

jars with xmlbeans compilation

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:

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <!--packages containing "impl" or "internal" are excluded by default -->
                        <Import-Package>org.apache.xmlbeans.impl.schema;version="2.4",*</Import-Package>
                        <!--<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>-->
                    </instructions>
                </configuration>
            </plugin>

Also, any package we may have with "impl" or "internal" needs to be explicitly listed in the Export-Packages.

Non-bundle interference

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

mvn dependency:tree

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.

  • No labels