felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart McCulloch <mccu...@gmail.com>
Subject Re: Does Bnd still write the Private-Package section?
Date Wed, 02 Nov 2011 14:28:55 GMT
On 1 Nov 2011, at 23:48, Adrien Ragot wrote:

> Dear all,
> 
> I have a question about Bnd 0.0.357 and above. It seems it doesn't write
> "Private-Package" in MANIFEST.MF anymore.
> 
> I'm using it through maven-bundle-plugin:

This was a feature request in maven-bundle-plugin 2.1.0 - by default it removes the non-standard
Include-Resource and Private-Package headers from the final generated manifest that goes into
the bundle. IIRC the main reason for removing these was to simplify the final manifest and
remove internal details (especially since the generated Include-Resource header can be extremely
verbose).

If you want the Private-Package header back you can set the Bnd removeheaders instruction,
like so:

        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <configuration>
            <instructions>
              <_removeheaders>Include-Resource</_removeheaders>
              <!-- etc... -->
            </instructions>
          </configuration>
        </plugin>

Out of interest, are you using the Private-Package header in your tooling? (it's not used
by OSGi)

> -maven-bundle-plugin 2.0.0 = Bnd 0.0.311
> -maven-bundle-plugin 2.1.0 = Bnd 0.0.357
> -maven-bundle-plugin 2.3.5 = Bnd 1.43.0 (latest)
> 
> If I execute a very simple pom:
> 
>            <plugin>
>                <groupId>org.apache.felix</groupId>
>                <artifactId>maven-bundle-plugin</artifactId>
>                <version>2.1.0</version>
>                <extensions>true</extensions>
>                <executions>
>                    <execution>
>                        <goals>
>                            <goal>manifest</goal>
>                        </goals>
>                    </execution>
>                </executions>
>                <configuration>
>                    <instructions>
>                        <Export-Package>org.adrien.exprt</Export-Package>
>                    </instructions>
>                </configuration>
>            </plugin>
> 
> Then MANIFEST.MF doesn't include Private-Package:
> Manifest-Version: 1.0
> Export-Package: org.adrien.exprt;version="1.4.0.SNAPSHOT"
> Bundle-Version: 1.4.0.SNAPSHOT
> Tool: Bnd-0.0.357
> Bundle-Name: Minimal Example for BndLib
> Bnd-LastModified: 1320189472660
> Created-By: 1.6.0_26 (Sun Microsystems Inc.)
> Bundle-ManifestVersion: 2
> Bundle-SymbolicName: org.adrien.minimal
> Import-Package: org.adrien.exprt;version="1.4"
> 
> Is this an expected behaviour?
> 
> It happens since Bnd 0.0.357 until Bnd 1.43.0 and it used to work properly
> with Bnd 0.0.311. See the full difference on this repo:
> https://bitbucket.org/aragot/discrepancywithbndlib/changeset/d68e6cf71732
> 
> Thanks,
> Adrien


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message