Thanks for the reply. Now I am running into another problem when I use the 
_exportcontents option. Just give some context

1. I have the following common configuration across all bundles
              <configuration>
                <instructions>
                  <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                  
<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
                  <Embed-Transitive>true</Embed-Transitive>
                  <!-- bnd instructions -->
                  <_include>src/main/resources/META-INF/MANIFEST.MF</_include>
                  <_exportcontents>*</_exportcontents>
                </instructions>
              </configuration>
2. I specify MANIFEST.MF for each bundle with 
    - Ignore-Package section for referred but missing code. This code is not 
invoked
    - Additional instructions are manually specified in MANIFEST.MF
    - Import-Package and Export-Package is removed so that "_exportcontents" 
option can auto generate this info
3. With the above settings the BND tool is including the manually specified 
Ignore-Packages from MANIFEST.MF
    - This leads to imports that does not have code. This leads to runtime error
   
How do I get the above to options work together (_include and _exportcontents) 
to have non-overlapping Import-Package and Ignore-Package data

Thanks again
-Ravi 



----- Original Message ----
From: Stuart McCulloch <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, December 25, 2007 6:58:49 PM
Subject: Re: Copies class files from embedded jars


On 24/12/2007, Ravindar Reddy <[EMAIL PROTECTED]> wrote:
>
>
> I am trying to create an example wrapper bundle around and existing
 jar
> file using maven-bundle-plugin (1.1.0-SNAPSHOT). I exported some
 packages
> from this embedded jar so that they can be used in other bundles. I
 found
> out that the bundle plug-in  copies and packages these exported class
 files
> into bundle while including the jar file. Is there a way to suppress
 this
> duplication of code as this code is part of the embedded jar


yes - this is documented on the bundleplugin wiki, which gets mirrored
 to
the main site at:

   http://felix.apache.org/site/maven-bundle-plugin-bnd.html

just search for the section on "Embed-Dependency and Export-Package"
 (copied
below):

If you embed a dependency with <Embed-Dependency>, and either your
<Export-Package>
or <Private-Package> instructions match packages inside the embedded
 jar,
you will see some
duplication inside the bundle.

This is because the <Export-Package> and <Private-Package> instructions
 will
result in
classes being inlined in the bundle, even though they also exist inside
 the
embedded jar.

If you want to export packages from an embedded dependency without such
duplication then
you can either inline the dependency, or use a new BND instruction
 called
<_exportcontents>.

<_exportcontents> behaves just like Export-Package, except it doesn't
 change
the content
of the bundle, just what content should be exported.

so just use <_exportcontents> to set your final exported packages, or
alternatively inline the jarfile.
Also note you can use both <Export-Package> and <_exportcontents> in
 the
same bundle, if you
want to pull in some classes from your classpath as well embed (and
 export)
a dependency.

Thanks,
> -Ravi
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Cheers, Stuart




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to