You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Adrien Ragot <ad...@gmail.com> on 2011/11/02 00:48:56 UTC

Does Bnd still write the Private-Package section?

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:
-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

Re: Does Bnd still write the Private-Package section?

Posted by Adrien Ragot <ad...@gmail.com>.
On Thu, Nov 3, 2011 at 1:28 AM, Stuart McCulloch <mc...@gmail.com> wrote:

> 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)
>

"Private-Package is not used by OSGi" - this is the answer I was looking
for. I'm upgrading from Bnd 0.0.311 to Bnd 1.43 and I'm trying to avoid
regressions. We don't use it in our tooling (we use OSGi) so there will be
no impact removing it. Thank you!

Adrien

NB: The list of standard headers for the Manifest:
http://www.osgi.org/Specifications/ReferenceHeaders


>
> > -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
>
>


-- 
Adrien Ragot
+61 (0)4 49 206 878

Re: Does Bnd still write the Private-Package section?

Posted by Stuart McCulloch <mc...@gmail.com>.
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