On 12 Aug 2012, at 03:54, Wayne Fay <wayne...@gmail.com> wrote:

>> I'm also using the Apache Felix bundle-plugin which allows for:
>> 
>>        <packaging>bundle</packaging>
> 
> This is not a packaging delivered by Apache Maven. Thus you can
> "blame" whoever is making this packaging available to you.
> 
>> That is, I can use either or of "bundle" or "jar" for packaging. However 
>> when i use:
>> 
>>        <packaging>bundle</packaging>
>> 
>> I don't get the META-INF/persistence.xml file in the jar.
> 
> Most likely the "bundle" packaging does not include META-INF for some
> reason. I would talk to the Apache Felix people about this issue so
> they can resolve it in their code.

This is working as designed, as covered in the FAQ:

   
http://felix.apache.org/site/apache-felix-bundle-plugin-faq.html#ApacheFelixBundlePluginFAQ-WhenIbuildabundle%252Csomeclassesarebuiltin%2522target%252Fclasses%2522butthey%2527renotincludedinthefinaljar.

Not everything in target/classes ends up in the bundle by default (unlike jar) 
- the underlying bnd library will only pull what resources/packages you tell it 
to into the bundle. While the plugin attempts to generate reasonable defaults 
based on your source, it can't do this for generated resources such as this 
persistence.xml file (see last FAQ item). Instead you need something like:

   <Include-Resource>{maven-resources}, 
META-INF/persistence.xml=target/classes/META-INF/persistence.xml</Include-Resource>

Where {maven-resources} is a placeholder for the default detected resources, as 
described in the Include-Resource section of 
http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

The raw format of bnd's Include-Resource instruction can be found at 
http://www.aqute.biz/Bnd/Format#include-resource

HTH

--
Cheers, Stuart

> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to