Florian,

I believe that part of the answer to your problem is explained in section 3.5.6 "Exporting and Importing a Package" of the core OSGi spec, which states that "Bundles should import exported packages, allowing the resolver to substitute packages that contain interfaces and other shared types."

A condensed explanation by Rick Hall is also available here:
http://felix.apache.org/site/apache-felix-osgi-faq.html#ApacheFelixOSGiFAQ-Shouldabundleimportitsownexportedpackages%253F

Arjun.



Florian Rampp wrote:
Hello!

I'm using the Maven-Bundle-Plugin and having problems with specifying 
export-package and import-package.

Since my package structure in java does not fit the default export-package 
(<groupId>.<artifactId>.*), I specify this on my own:
<plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
                <instructions>
                        <Export-Package>deus.model.*</Export-Package>
                </instructions>
        </configuration>
</plugin>

The effect is, that all packages are exported (good!) and that also, all 
packages contained in the bundle appear in the field Import-Package, although, 
they are contained in the bundle (not so good).
Why?

If I exclude the packages from this bundle from importing:
<plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
                <instructions>
                        <Export-Package>deus.model.*</Export-Package>
                        <Import-Package>!deus.model.*,*</Import-Package>
                </instructions>
        </configuration>
</plugin>

All packages being in Import-Package before now appear in the header 
Ignore-Package (it's getting worse...). What is this header for?
I can't imagine how to simply export all classes of my package while not 
importing the packages contained in the bundle.

To further complicate this (actually not so complicated) issue, I would like to prevent 
everything inside an "impl" package from getting exported.
How to do this?
<Export-Package>!*.impl,deus.model.*</ExportPackage>
would fit my needs perfectly, but it looks like the wildcard * is only 
recognized at the end of a package path pattern.

I would really be glad, if somebody could help me, these issues really drive me 
crazy.

Thanks a lot!

Florian


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to