Hi,

I am trying to make a fragment using the Maven Bundle Plugin. The fragment
needs to do a wildcard import of a specific package, because I do not know
upfront which subpackages are needed.

In my case the fragment is needed to add a number of subpackages from the
hibernate-core bundle to the ehcahce bundle to prevent
ClassNotFoundExceptions when using EHCache as the 2nd Level Cache for
Hibernate.

I tried all versions of the bundle plugin between 2.4.0 and 3.0.1. All give
the same result.
When I use a wildcard import I get a MANIFEST.MF without an Import-Package
section.
When I specify some subpackages explicitly I get a MANFIEST.MF with an
Import-Package section.

Is this by design? Is my configuration wrong?

The following configuration for the Maven Bundle Plugin gives me a
MANIFEST.MF without an Import-Package section:

                        <configuration>
                            <instructions>

<Fragment-Host>net.sf.ehcache</Fragment-Host>
                                <Import-Package>
                                    org.hibernate.*;resolution:=optional
                                </Import-Package>
                                <Private-Package>dummy</Private-Package>
                            </instructions>
                        </configuration>


The following configuration for the Maven Bundle Plugin gives me a
MANIFEST.MF with an Import-Package section:

                        <configuration>
                            <instructions>

<Fragment-Host>net.sf.ehcache</Fragment-Host>
                                <Import-Package>

org.hibernate.transform;resolution:=optional,
                                    org.hibernate.type;resolution:=optional,

org.hibernate.cache.internal;resolution:=optional,

org.hibernate.cache.spi;resolution:=optional,

org.hibernate.cache.spi.access;resolution:=optional,

org.hibernate.cache.spi.entry;resolution:=optional,

org.hibernate.engine.spi;resolution:=optional
                                </Import-Package>
                                <Private-Package>dummy</Private-Package>
                            </instructions>
                        </configuration>

Only the latter situation brings me in a trial and error scenario. Adding
new subpackages as I move a long.

Regards, Ton

Reply via email to