You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Carlos Sanchez <ca...@apache.org> on 2007/02/07 03:26:05 UTC

[bnd] Generating bundle from jar with only its contents

This may be more a BND question, but here it goes

Is there a way to generate a bundle that matches exactly the contents
of a jar (besides the manifest of course)?

For what I've seen so far you need to pass the whole classpath to BND
so it can generate import headers with versions, and EXPORT_PACKAGE to
tell it what packages you want. i'm looking for an easy way to to
express export everything in this jar and nothing else. IIRC that was
the way the osgi maven plugin worked, creating bundles 1 to 1 from
jars.

tia

-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

Re: [bnd] Generating bundle from jar with only its contents

Posted by Carlos Sanchez <ca...@apache.org>.
what i've done so far, and I think you may find useful, it's a new
recursivebundle goal that will iterate through all dependency tree,
both direct and transitive dependencies, and generate a bundle for
each of them. You won't need to play with the dependency plugin.

FELIX-199
http://svn.apache.org/repos/asf/maven/sandbox/plugins/maven-bundle-plugin/

It still needs some polishing but will be finished soon.

On 2/6/07, Chris Custine <ch...@gmail.com> wrote:
> My solution isn't exactly automatic and transparent because you need to
> create a maven pom.xml, but what I do is create a simple pom that lists the
> original jar as a dependency, uses the dependency-maven-plugin to extract
> the contents to target/classes, and then uses the maven-bundle-plugin to
> package as a bundle.  I do this for all 3rd party jars that I need to
> package as bundles and I just keep them in a large project in SVN and then
> my CI builds rebuild when I make changes and deploy to my internal maven
> repository.  I use bnd from a command line to figure out what the imports
> are, etc. before creating the pom.
>
> I realize from your question that you probably want something transparent
> without maintaining a pom, but I think what you are asking for can be done
> with a little tweaking...
>
> I have attached a sample pom.xml from one of my projects.
>
> Chris
>
>
>
> On 2/6/07, Carlos Sanchez <ca...@apache.org> wrote:
> > This may be more a BND question, but here it goes
> >
> > Is there a way to generate a bundle that matches exactly the contents
> > of a jar (besides the manifest of course)?
> >
> > For what I've seen so far you need to pass the whole classpath to BND
> > so it can generate import headers with versions, and EXPORT_PACKAGE to
> > tell it what packages you want. i'm looking for an easy way to to
> > express export everything in this jar and nothing else. IIRC that was
> > the way the osgi maven plugin worked, creating bundles 1 to 1 from
> > jars.
> >
> > tia
> >
> > --
> > I could give you my word as a Spaniard.
> > No good. I've known too many Spaniards.
> >                              -- The Princess Bride
> >
>
>
>


-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

Re: [bnd] Generating bundle from jar with only its contents

Posted by Chris Custine <ch...@gmail.com>.
My solution isn't exactly automatic and transparent because you need to
create a maven pom.xml, but what I do is create a simple pom that lists the
original jar as a dependency, uses the dependency-maven-plugin to extract
the contents to target/classes, and then uses the maven-bundle-plugin to
package as a bundle.  I do this for all 3rd party jars that I need to
package as bundles and I just keep them in a large project in SVN and then
my CI builds rebuild when I make changes and deploy to my internal maven
repository.  I use bnd from a command line to figure out what the imports
are, etc. before creating the pom.

I realize from your question that you probably want something transparent
without maintaining a pom, but I think what you are asking for can be done
with a little tweaking...

I have attached a sample pom.xml from one of my projects.

Chris


On 2/6/07, Carlos Sanchez <ca...@apache.org> wrote:
>
> This may be more a BND question, but here it goes
>
> Is there a way to generate a bundle that matches exactly the contents
> of a jar (besides the manifest of course)?
>
> For what I've seen so far you need to pass the whole classpath to BND
> so it can generate import headers with versions, and EXPORT_PACKAGE to
> tell it what packages you want. i'm looking for an easy way to to
> express export everything in this jar and nothing else. IIRC that was
> the way the osgi maven plugin worked, creating bundles 1 to 1 from
> jars.
>
> tia
>
> --
> I could give you my word as a Spaniard.
> No good. I've known too many Spaniards.
>                              -- The Princess Bride
>

Re[6]: [bnd] Generating bundle from jar with only its contents

Posted by Peter Kriens <Pe...@aQute.biz>.
I have just updated the bundle, there was also a bug with using
Bundle-ClassPath. I also moved the methods to Analyzer and made the
others public.

http://www.aqute.biz/Code/Download

Hope this helps. Kind regards,

     Peter Kriens

CS> On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> CS> if I'm getting it right looking through the sources what you have done
>> CS> is set EXPORT_BUNDLE to all packages in the jar and pass that to the
>> CS> lower layers, making a bundle that will have all packages in the
>> CS> classpath that the original jar had.
>> CS> I tried that before and had some problems
>> CS> - if a package is in two jars in the classpath both classes end in
>> CS> bundle and you get no warnings
>> CS> - if there are resources in places like root or META-INF (usually
>> CS> license or notice files) you may get the ones from other jars.
>>
>> I am using only the Analyzer class and therefore do not construct the
>> JAR. I am using the original contents and do not add or remove
>> anything. I am only calculating the manifest and merging it with the
>> original and then writing out a copy. So this should not be a problem.
>> If you look at wrap, you'll see I never do build, I give the original
>> JAR to the analyzer.
>>
>> Did you try it out on some bundles?

CS> I got it working now, i didn't saw it because i'm using the libraries
CS> directly, not the bnd class.

CS> Could you please:
CS> - move calculateExportsFromContents and mergeManifest from bnd to
CS> Analyzer as public methods
CS> - make Processor#analyzeBundleClasspath protected

CS> that way it's easier to use and extend

CS> I think that's gonna be all the things I need for the maven plugin.

CS> Thanks!

>>
>> Kind regards,
>>
>>      Peter Kriens
>>
>>
>>
>> CS> That's why I decided to implement it passing a new classpath that will
>> CS> be used to export packages only, so nothing else gets in the
>> CS> destination bundle.
>>
>>
>> CS> On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> >> See if I understand. You want to have a bundle classpath and a target
>> >> jar T. Bnd should then assume the contents of T are all exports but use
>> >> the versions from the classpath for imports?
>> >>
>> >> If so, it must be your lucky day! :-)
>> >>
>> >> I have changed the bnd wrap command to accept a classpath and
>> >> calculate the Export-Package statement from the contents of the target
>> >> jar. Read more:
>> >>
>> >>     http://www.aqute.biz/Code/Bnd#wrap
>> >>
>> >> I have not exhaustively tested it but it was a small change ... and it
>> >> seemed to work for the jars I tried. Latest version is 0.0.110.
>> >>
>> >>      http://www.aqute.biz/Code/Download
>> >>
>> >> Kind regards,
>> >>
>> >>      Peter Kriens
>> >>
>> >>
>> >>
>> >>
>> >> CS> yes, i've seen that, and was my first implementation for the maven
>> >> CS> plugin, but it misses the version information on the imports.
>> >> CS> Would that be an acceptable feature for BND?
>> >>
>> >> CS> On 2/6/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> >> >> It is ok for bnd to not find the imports, you just do not get any
>> >> >> versions.
>> >> >>
>> >> >> The bnd command line has a wrap command that seems to do what you
>> >> >> want.    http://www.aqute.biz/Code/Bnd
>> >> >>
>> >> >> Kind regards,
>> >> >>
>> >> >>      Peter Kriens
>> >> >>
>> >> >> CS> This may be more a BND question, but here it goes
>> >> >>
>> >> >> CS> Is there a way to generate a bundle that matches exactly the contents
>> >> >> CS> of a jar (besides the manifest of course)?
>> >> >>
>> >> >> CS> For what I've seen so far you need to pass the whole classpath to BND
>> >> >> CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
>> >> >> CS> tell it what packages you want. i'm looking for an easy way to to
>> >> >> CS> express export everything in this jar and nothing else. IIRC that was
>> >> >> CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
>> >> >> CS> jars.
>> >> >>
>> >> >> CS> tia
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Peter Kriens                              Tel +33467542167
>> >> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> >> >> 34160 Beaulieu, France                    ICQ 255570717
>> >> >> Skype pkriens                             Fax +1 8153772599
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Peter Kriens                              Tel +33467542167
>> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> >> 34160 Beaulieu, France                    ICQ 255570717
>> >> Skype pkriens                             Fax +1 8153772599
>> >>
>> >>
>>
>>
>>
>>
>> --
>> Peter Kriens                              Tel +33467542167
>> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> 34160 Beaulieu, France                    ICQ 255570717
>> Skype pkriens                             Fax +1 8153772599
>>
>>




-- 
Peter Kriens                              Tel +33467542167
9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
34160 Beaulieu, France                    ICQ 255570717
Skype pkriens                             Fax +1 8153772599


Re: Re[4]: [bnd] Generating bundle from jar with only its contents

Posted by Carlos Sanchez <ca...@apache.org>.
On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
> CS> if I'm getting it right looking through the sources what you have done
> CS> is set EXPORT_BUNDLE to all packages in the jar and pass that to the
> CS> lower layers, making a bundle that will have all packages in the
> CS> classpath that the original jar had.
> CS> I tried that before and had some problems
> CS> - if a package is in two jars in the classpath both classes end in
> CS> bundle and you get no warnings
> CS> - if there are resources in places like root or META-INF (usually
> CS> license or notice files) you may get the ones from other jars.
>
> I am using only the Analyzer class and therefore do not construct the
> JAR. I am using the original contents and do not add or remove
> anything. I am only calculating the manifest and merging it with the
> original and then writing out a copy. So this should not be a problem.
> If you look at wrap, you'll see I never do build, I give the original
> JAR to the analyzer.
>
> Did you try it out on some bundles?

I got it working now, i didn't saw it because i'm using the libraries
directly, not the bnd class.

Could you please:
- move calculateExportsFromContents and mergeManifest from bnd to
Analyzer as public methods
- make Processor#analyzeBundleClasspath protected

that way it's easier to use and extend

I think that's gonna be all the things I need for the maven plugin.

Thanks!

>
> Kind regards,
>
>      Peter Kriens
>
>
>
> CS> That's why I decided to implement it passing a new classpath that will
> CS> be used to export packages only, so nothing else gets in the
> CS> destination bundle.
>
>
> CS> On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
> >> See if I understand. You want to have a bundle classpath and a target
> >> jar T. Bnd should then assume the contents of T are all exports but use
> >> the versions from the classpath for imports?
> >>
> >> If so, it must be your lucky day! :-)
> >>
> >> I have changed the bnd wrap command to accept a classpath and
> >> calculate the Export-Package statement from the contents of the target
> >> jar. Read more:
> >>
> >>     http://www.aqute.biz/Code/Bnd#wrap
> >>
> >> I have not exhaustively tested it but it was a small change ... and it
> >> seemed to work for the jars I tried. Latest version is 0.0.110.
> >>
> >>      http://www.aqute.biz/Code/Download
> >>
> >> Kind regards,
> >>
> >>      Peter Kriens
> >>
> >>
> >>
> >>
> >> CS> yes, i've seen that, and was my first implementation for the maven
> >> CS> plugin, but it misses the version information on the imports.
> >> CS> Would that be an acceptable feature for BND?
> >>
> >> CS> On 2/6/07, Peter Kriens <Pe...@aqute.biz> wrote:
> >> >> It is ok for bnd to not find the imports, you just do not get any
> >> >> versions.
> >> >>
> >> >> The bnd command line has a wrap command that seems to do what you
> >> >> want.    http://www.aqute.biz/Code/Bnd
> >> >>
> >> >> Kind regards,
> >> >>
> >> >>      Peter Kriens
> >> >>
> >> >> CS> This may be more a BND question, but here it goes
> >> >>
> >> >> CS> Is there a way to generate a bundle that matches exactly the contents
> >> >> CS> of a jar (besides the manifest of course)?
> >> >>
> >> >> CS> For what I've seen so far you need to pass the whole classpath to BND
> >> >> CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
> >> >> CS> tell it what packages you want. i'm looking for an easy way to to
> >> >> CS> express export everything in this jar and nothing else. IIRC that was
> >> >> CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
> >> >> CS> jars.
> >> >>
> >> >> CS> tia
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Peter Kriens                              Tel +33467542167
> >> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> >> >> 34160 Beaulieu, France                    ICQ 255570717
> >> >> Skype pkriens                             Fax +1 8153772599
> >> >>
> >> >>
> >>
> >>
> >>
> >>
> >> --
> >> Peter Kriens                              Tel +33467542167
> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> >> 34160 Beaulieu, France                    ICQ 255570717
> >> Skype pkriens                             Fax +1 8153772599
> >>
> >>
>
>
>
>
> --
> Peter Kriens                              Tel +33467542167
> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> 34160 Beaulieu, France                    ICQ 255570717
> Skype pkriens                             Fax +1 8153772599
>
>


-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

Re[4]: [bnd] Generating bundle from jar with only its contents

Posted by Peter Kriens <Pe...@aQute.biz>.
CS> if I'm getting it right looking through the sources what you have done
CS> is set EXPORT_BUNDLE to all packages in the jar and pass that to the
CS> lower layers, making a bundle that will have all packages in the
CS> classpath that the original jar had.
CS> I tried that before and had some problems
CS> - if a package is in two jars in the classpath both classes end in
CS> bundle and you get no warnings
CS> - if there are resources in places like root or META-INF (usually
CS> license or notice files) you may get the ones from other jars.

I am using only the Analyzer class and therefore do not construct the
JAR. I am using the original contents and do not add or remove
anything. I am only calculating the manifest and merging it with the
original and then writing out a copy. So this should not be a problem.
If you look at wrap, you'll see I never do build, I give the original
JAR to the analyzer.

Did you try it out on some bundles?

Kind regards,

     Peter Kriens



CS> That's why I decided to implement it passing a new classpath that will
CS> be used to export packages only, so nothing else gets in the
CS> destination bundle.


CS> On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> See if I understand. You want to have a bundle classpath and a target
>> jar T. Bnd should then assume the contents of T are all exports but use
>> the versions from the classpath for imports?
>>
>> If so, it must be your lucky day! :-)
>>
>> I have changed the bnd wrap command to accept a classpath and
>> calculate the Export-Package statement from the contents of the target
>> jar. Read more:
>>
>>     http://www.aqute.biz/Code/Bnd#wrap
>>
>> I have not exhaustively tested it but it was a small change ... and it
>> seemed to work for the jars I tried. Latest version is 0.0.110.
>>
>>      http://www.aqute.biz/Code/Download
>>
>> Kind regards,
>>
>>      Peter Kriens
>>
>>
>>
>>
>> CS> yes, i've seen that, and was my first implementation for the maven
>> CS> plugin, but it misses the version information on the imports.
>> CS> Would that be an acceptable feature for BND?
>>
>> CS> On 2/6/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> >> It is ok for bnd to not find the imports, you just do not get any
>> >> versions.
>> >>
>> >> The bnd command line has a wrap command that seems to do what you
>> >> want.    http://www.aqute.biz/Code/Bnd
>> >>
>> >> Kind regards,
>> >>
>> >>      Peter Kriens
>> >>
>> >> CS> This may be more a BND question, but here it goes
>> >>
>> >> CS> Is there a way to generate a bundle that matches exactly the contents
>> >> CS> of a jar (besides the manifest of course)?
>> >>
>> >> CS> For what I've seen so far you need to pass the whole classpath to BND
>> >> CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
>> >> CS> tell it what packages you want. i'm looking for an easy way to to
>> >> CS> express export everything in this jar and nothing else. IIRC that was
>> >> CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
>> >> CS> jars.
>> >>
>> >> CS> tia
>> >>
>> >>
>> >>
>> >> --
>> >> Peter Kriens                              Tel +33467542167
>> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> >> 34160 Beaulieu, France                    ICQ 255570717
>> >> Skype pkriens                             Fax +1 8153772599
>> >>
>> >>
>>
>>
>>
>>
>> --
>> Peter Kriens                              Tel +33467542167
>> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> 34160 Beaulieu, France                    ICQ 255570717
>> Skype pkriens                             Fax +1 8153772599
>>
>>




-- 
Peter Kriens                              Tel +33467542167
9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
34160 Beaulieu, France                    ICQ 255570717
Skype pkriens                             Fax +1 8153772599


Re: Re[2]: [bnd] Generating bundle from jar with only its contents

Posted by Carlos Sanchez <ca...@apache.org>.
if I'm getting it right looking through the sources what you have done
is set EXPORT_BUNDLE to all packages in the jar and pass that to the
lower layers, making a bundle that will have all packages in the
classpath that the original jar had.

I tried that before and had some problems
- if a package is in two jars in the classpath both classes end in
bundle and you get no warnings
- if there are resources in places like root or META-INF (usually
license or notice files) you may get the ones from other jars.

That's why I decided to implement it passing a new classpath that will
be used to export packages only, so nothing else gets in the
destination bundle.


On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
> See if I understand. You want to have a bundle classpath and a target
> jar T. Bnd should then assume the contents of T are all exports but use
> the versions from the classpath for imports?
>
> If so, it must be your lucky day! :-)
>
> I have changed the bnd wrap command to accept a classpath and
> calculate the Export-Package statement from the contents of the target
> jar. Read more:
>
>     http://www.aqute.biz/Code/Bnd#wrap
>
> I have not exhaustively tested it but it was a small change ... and it
> seemed to work for the jars I tried. Latest version is 0.0.110.
>
>      http://www.aqute.biz/Code/Download
>
> Kind regards,
>
>      Peter Kriens
>
>
>
>
> CS> yes, i've seen that, and was my first implementation for the maven
> CS> plugin, but it misses the version information on the imports.
> CS> Would that be an acceptable feature for BND?
>
> CS> On 2/6/07, Peter Kriens <Pe...@aqute.biz> wrote:
> >> It is ok for bnd to not find the imports, you just do not get any
> >> versions.
> >>
> >> The bnd command line has a wrap command that seems to do what you
> >> want.    http://www.aqute.biz/Code/Bnd
> >>
> >> Kind regards,
> >>
> >>      Peter Kriens
> >>
> >> CS> This may be more a BND question, but here it goes
> >>
> >> CS> Is there a way to generate a bundle that matches exactly the contents
> >> CS> of a jar (besides the manifest of course)?
> >>
> >> CS> For what I've seen so far you need to pass the whole classpath to BND
> >> CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
> >> CS> tell it what packages you want. i'm looking for an easy way to to
> >> CS> express export everything in this jar and nothing else. IIRC that was
> >> CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
> >> CS> jars.
> >>
> >> CS> tia
> >>
> >>
> >>
> >> --
> >> Peter Kriens                              Tel +33467542167
> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> >> 34160 Beaulieu, France                    ICQ 255570717
> >> Skype pkriens                             Fax +1 8153772599
> >>
> >>
>
>
>
>
> --
> Peter Kriens                              Tel +33467542167
> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> 34160 Beaulieu, France                    ICQ 255570717
> Skype pkriens                             Fax +1 8153772599
>
>


-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

Re[6]: [bnd] Generating bundle from jar with only its contents

Posted by Peter Kriens <Pe...@aQute.biz>.
Sorry, working on implementing signing but that is not ready for prime
time and the imports were not removed ... I have updated 0.0.110 with
cleaned up sources.

Kind regards,

     Peter Kriens
     
CS> BTW there are unneeded imports that make the compilation fail with the
CS> sources inside that jar

CS> bnd\src\main\java\aQute\bnd\main\bnd.java:[13,0] package
CS> aQute.lib.signing does not exist
CS> bnd\src\main\java\aQute\lib\osgi\Builder.java:[5,0] package
CS> aQute.lib.signing does not exist


CS> On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> I deployed it to 109 :-(
>>
>> http://www.aqute.biz/repo/biz/aQute/bnd/0.0.110/bnd-0.0.110.jar
>>
>> I have a flag in the deploy to update the version in the bnd file but
>> it is not the default, maybe should change this.
>>
>> Kind regards,
>>
>>      Peter Kriens
>>
>> CS> On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> >> See if I understand. You want to have a bundle classpath and a target
>> >> jar T. Bnd should then assume the contents of T are all exports but use
>> >> the versions from the classpath for imports?
>> >>
>> >> If so, it must be your lucky day! :-)
>>
>> CS> seems we implemented the same thing at the same time ;)
>>
>> >>
>> >> I have changed the bnd wrap command to accept a classpath and
>> >> calculate the Export-Package statement from the contents of the target
>> >> jar. Read more:
>> >>
>> >>     http://www.aqute.biz/Code/Bnd#wrap
>> >>
>> >> I have not exhaustively tested it but it was a small change ... and it
>> >> seemed to work for the jars I tried. Latest version is 0.0.110.
>> >>
>> >>      http://www.aqute.biz/Code/Download
>>
>> CS> it's not showing up, the link there is broken
>>
>> >>
>> >> Kind regards,
>> >>
>> >>      Peter Kriens
>> >>
>> >>
>> >>
>> >>
>> >> CS> yes, i've seen that, and was my first implementation for the maven
>> >> CS> plugin, but it misses the version information on the imports.
>> >> CS> Would that be an acceptable feature for BND?
>> >>
>> >> CS> On 2/6/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> >> >> It is ok for bnd to not find the imports, you just do not get any
>> >> >> versions.
>> >> >>
>> >> >> The bnd command line has a wrap command that seems to do what you
>> >> >> want.    http://www.aqute.biz/Code/Bnd
>> >> >>
>> >> >> Kind regards,
>> >> >>
>> >> >>      Peter Kriens
>> >> >>
>> >> >> CS> This may be more a BND question, but here it goes
>> >> >>
>> >> >> CS> Is there a way to generate a bundle that matches exactly the contents
>> >> >> CS> of a jar (besides the manifest of course)?
>> >> >>
>> >> >> CS> For what I've seen so far you need to pass the whole classpath to BND
>> >> >> CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
>> >> >> CS> tell it what packages you want. i'm looking for an easy way to to
>> >> >> CS> express export everything in this jar and nothing else. IIRC that was
>> >> >> CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
>> >> >> CS> jars.
>> >> >>
>> >> >> CS> tia
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Peter Kriens                              Tel +33467542167
>> >> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> >> >> 34160 Beaulieu, France                    ICQ 255570717
>> >> >> Skype pkriens                             Fax +1 8153772599
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Peter Kriens                              Tel +33467542167
>> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> >> 34160 Beaulieu, France                    ICQ 255570717
>> >> Skype pkriens                             Fax +1 8153772599
>> >>
>> >>
>>
>>
>>
>>
>> --
>> Peter Kriens                              Tel +33467542167
>> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> 34160 Beaulieu, France                    ICQ 255570717
>> Skype pkriens                             Fax +1 8153772599
>>
>>




-- 
Peter Kriens                              Tel +33467542167
9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
34160 Beaulieu, France                    ICQ 255570717
Skype pkriens                             Fax +1 8153772599


Re: Re[4]: [bnd] Generating bundle from jar with only its contents

Posted by Carlos Sanchez <ca...@apache.org>.
BTW there are unneeded imports that make the compilation fail with the
sources inside that jar

bnd\src\main\java\aQute\bnd\main\bnd.java:[13,0] package
aQute.lib.signing does not exist
bnd\src\main\java\aQute\lib\osgi\Builder.java:[5,0] package
aQute.lib.signing does not exist


On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
> I deployed it to 109 :-(
>
> http://www.aqute.biz/repo/biz/aQute/bnd/0.0.110/bnd-0.0.110.jar
>
> I have a flag in the deploy to update the version in the bnd file but
> it is not the default, maybe should change this.
>
> Kind regards,
>
>      Peter Kriens
>
> CS> On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
> >> See if I understand. You want to have a bundle classpath and a target
> >> jar T. Bnd should then assume the contents of T are all exports but use
> >> the versions from the classpath for imports?
> >>
> >> If so, it must be your lucky day! :-)
>
> CS> seems we implemented the same thing at the same time ;)
>
> >>
> >> I have changed the bnd wrap command to accept a classpath and
> >> calculate the Export-Package statement from the contents of the target
> >> jar. Read more:
> >>
> >>     http://www.aqute.biz/Code/Bnd#wrap
> >>
> >> I have not exhaustively tested it but it was a small change ... and it
> >> seemed to work for the jars I tried. Latest version is 0.0.110.
> >>
> >>      http://www.aqute.biz/Code/Download
>
> CS> it's not showing up, the link there is broken
>
> >>
> >> Kind regards,
> >>
> >>      Peter Kriens
> >>
> >>
> >>
> >>
> >> CS> yes, i've seen that, and was my first implementation for the maven
> >> CS> plugin, but it misses the version information on the imports.
> >> CS> Would that be an acceptable feature for BND?
> >>
> >> CS> On 2/6/07, Peter Kriens <Pe...@aqute.biz> wrote:
> >> >> It is ok for bnd to not find the imports, you just do not get any
> >> >> versions.
> >> >>
> >> >> The bnd command line has a wrap command that seems to do what you
> >> >> want.    http://www.aqute.biz/Code/Bnd
> >> >>
> >> >> Kind regards,
> >> >>
> >> >>      Peter Kriens
> >> >>
> >> >> CS> This may be more a BND question, but here it goes
> >> >>
> >> >> CS> Is there a way to generate a bundle that matches exactly the contents
> >> >> CS> of a jar (besides the manifest of course)?
> >> >>
> >> >> CS> For what I've seen so far you need to pass the whole classpath to BND
> >> >> CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
> >> >> CS> tell it what packages you want. i'm looking for an easy way to to
> >> >> CS> express export everything in this jar and nothing else. IIRC that was
> >> >> CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
> >> >> CS> jars.
> >> >>
> >> >> CS> tia
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Peter Kriens                              Tel +33467542167
> >> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> >> >> 34160 Beaulieu, France                    ICQ 255570717
> >> >> Skype pkriens                             Fax +1 8153772599
> >> >>
> >> >>
> >>
> >>
> >>
> >>
> >> --
> >> Peter Kriens                              Tel +33467542167
> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> >> 34160 Beaulieu, France                    ICQ 255570717
> >> Skype pkriens                             Fax +1 8153772599
> >>
> >>
>
>
>
>
> --
> Peter Kriens                              Tel +33467542167
> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> 34160 Beaulieu, France                    ICQ 255570717
> Skype pkriens                             Fax +1 8153772599
>
>


-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

Re[4]: [bnd] Generating bundle from jar with only its contents

Posted by Peter Kriens <Pe...@aQute.biz>.
I deployed it to 109 :-(

http://www.aqute.biz/repo/biz/aQute/bnd/0.0.110/bnd-0.0.110.jar

I have a flag in the deploy to update the version in the bnd file but
it is not the default, maybe should change this.

Kind regards,

     Peter Kriens
     
CS> On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> See if I understand. You want to have a bundle classpath and a target
>> jar T. Bnd should then assume the contents of T are all exports but use
>> the versions from the classpath for imports?
>>
>> If so, it must be your lucky day! :-)

CS> seems we implemented the same thing at the same time ;)

>>
>> I have changed the bnd wrap command to accept a classpath and
>> calculate the Export-Package statement from the contents of the target
>> jar. Read more:
>>
>>     http://www.aqute.biz/Code/Bnd#wrap
>>
>> I have not exhaustively tested it but it was a small change ... and it
>> seemed to work for the jars I tried. Latest version is 0.0.110.
>>
>>      http://www.aqute.biz/Code/Download

CS> it's not showing up, the link there is broken

>>
>> Kind regards,
>>
>>      Peter Kriens
>>
>>
>>
>>
>> CS> yes, i've seen that, and was my first implementation for the maven
>> CS> plugin, but it misses the version information on the imports.
>> CS> Would that be an acceptable feature for BND?
>>
>> CS> On 2/6/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> >> It is ok for bnd to not find the imports, you just do not get any
>> >> versions.
>> >>
>> >> The bnd command line has a wrap command that seems to do what you
>> >> want.    http://www.aqute.biz/Code/Bnd
>> >>
>> >> Kind regards,
>> >>
>> >>      Peter Kriens
>> >>
>> >> CS> This may be more a BND question, but here it goes
>> >>
>> >> CS> Is there a way to generate a bundle that matches exactly the contents
>> >> CS> of a jar (besides the manifest of course)?
>> >>
>> >> CS> For what I've seen so far you need to pass the whole classpath to BND
>> >> CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
>> >> CS> tell it what packages you want. i'm looking for an easy way to to
>> >> CS> express export everything in this jar and nothing else. IIRC that was
>> >> CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
>> >> CS> jars.
>> >>
>> >> CS> tia
>> >>
>> >>
>> >>
>> >> --
>> >> Peter Kriens                              Tel +33467542167
>> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> >> 34160 Beaulieu, France                    ICQ 255570717
>> >> Skype pkriens                             Fax +1 8153772599
>> >>
>> >>
>>
>>
>>
>>
>> --
>> Peter Kriens                              Tel +33467542167
>> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> 34160 Beaulieu, France                    ICQ 255570717
>> Skype pkriens                             Fax +1 8153772599
>>
>>




-- 
Peter Kriens                              Tel +33467542167
9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
34160 Beaulieu, France                    ICQ 255570717
Skype pkriens                             Fax +1 8153772599


Re: Re[2]: [bnd] Generating bundle from jar with only its contents

Posted by Carlos Sanchez <ca...@apache.org>.
On 2/8/07, Peter Kriens <Pe...@aqute.biz> wrote:
> See if I understand. You want to have a bundle classpath and a target
> jar T. Bnd should then assume the contents of T are all exports but use
> the versions from the classpath for imports?
>
> If so, it must be your lucky day! :-)

seems we implemented the same thing at the same time ;)

>
> I have changed the bnd wrap command to accept a classpath and
> calculate the Export-Package statement from the contents of the target
> jar. Read more:
>
>     http://www.aqute.biz/Code/Bnd#wrap
>
> I have not exhaustively tested it but it was a small change ... and it
> seemed to work for the jars I tried. Latest version is 0.0.110.
>
>      http://www.aqute.biz/Code/Download

it's not showing up, the link there is broken

>
> Kind regards,
>
>      Peter Kriens
>
>
>
>
> CS> yes, i've seen that, and was my first implementation for the maven
> CS> plugin, but it misses the version information on the imports.
> CS> Would that be an acceptable feature for BND?
>
> CS> On 2/6/07, Peter Kriens <Pe...@aqute.biz> wrote:
> >> It is ok for bnd to not find the imports, you just do not get any
> >> versions.
> >>
> >> The bnd command line has a wrap command that seems to do what you
> >> want.    http://www.aqute.biz/Code/Bnd
> >>
> >> Kind regards,
> >>
> >>      Peter Kriens
> >>
> >> CS> This may be more a BND question, but here it goes
> >>
> >> CS> Is there a way to generate a bundle that matches exactly the contents
> >> CS> of a jar (besides the manifest of course)?
> >>
> >> CS> For what I've seen so far you need to pass the whole classpath to BND
> >> CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
> >> CS> tell it what packages you want. i'm looking for an easy way to to
> >> CS> express export everything in this jar and nothing else. IIRC that was
> >> CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
> >> CS> jars.
> >>
> >> CS> tia
> >>
> >>
> >>
> >> --
> >> Peter Kriens                              Tel +33467542167
> >> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> >> 34160 Beaulieu, France                    ICQ 255570717
> >> Skype pkriens                             Fax +1 8153772599
> >>
> >>
>
>
>
>
> --
> Peter Kriens                              Tel +33467542167
> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> 34160 Beaulieu, France                    ICQ 255570717
> Skype pkriens                             Fax +1 8153772599
>
>


-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

Re[2]: [bnd] Generating bundle from jar with only its contents

Posted by Peter Kriens <Pe...@aQute.biz>.
See if I understand. You want to have a bundle classpath and a target
jar T. Bnd should then assume the contents of T are all exports but use
the versions from the classpath for imports?

If so, it must be your lucky day! :-)

I have changed the bnd wrap command to accept a classpath and
calculate the Export-Package statement from the contents of the target
jar. Read more:

    http://www.aqute.biz/Code/Bnd#wrap

I have not exhaustively tested it but it was a small change ... and it
seemed to work for the jars I tried. Latest version is 0.0.110.

     http://www.aqute.biz/Code/Download

Kind regards,

     Peter Kriens




CS> yes, i've seen that, and was my first implementation for the maven
CS> plugin, but it misses the version information on the imports.
CS> Would that be an acceptable feature for BND?

CS> On 2/6/07, Peter Kriens <Pe...@aqute.biz> wrote:
>> It is ok for bnd to not find the imports, you just do not get any
>> versions.
>>
>> The bnd command line has a wrap command that seems to do what you
>> want.    http://www.aqute.biz/Code/Bnd
>>
>> Kind regards,
>>
>>      Peter Kriens
>>
>> CS> This may be more a BND question, but here it goes
>>
>> CS> Is there a way to generate a bundle that matches exactly the contents
>> CS> of a jar (besides the manifest of course)?
>>
>> CS> For what I've seen so far you need to pass the whole classpath to BND
>> CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
>> CS> tell it what packages you want. i'm looking for an easy way to to
>> CS> express export everything in this jar and nothing else. IIRC that was
>> CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
>> CS> jars.
>>
>> CS> tia
>>
>>
>>
>> --
>> Peter Kriens                              Tel +33467542167
>> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
>> 34160 Beaulieu, France                    ICQ 255570717
>> Skype pkriens                             Fax +1 8153772599
>>
>>




-- 
Peter Kriens                              Tel +33467542167
9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
34160 Beaulieu, France                    ICQ 255570717
Skype pkriens                             Fax +1 8153772599


Re: [bnd] Generating bundle from jar with only its contents

Posted by Carlos Sanchez <ca...@apache.org>.
yes, i've seen that, and was my first implementation for the maven
plugin, but it misses the version information on the imports.
Would that be an acceptable feature for BND?

On 2/6/07, Peter Kriens <Pe...@aqute.biz> wrote:
> It is ok for bnd to not find the imports, you just do not get any
> versions.
>
> The bnd command line has a wrap command that seems to do what you
> want.    http://www.aqute.biz/Code/Bnd
>
> Kind regards,
>
>      Peter Kriens
>
> CS> This may be more a BND question, but here it goes
>
> CS> Is there a way to generate a bundle that matches exactly the contents
> CS> of a jar (besides the manifest of course)?
>
> CS> For what I've seen so far you need to pass the whole classpath to BND
> CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
> CS> tell it what packages you want. i'm looking for an easy way to to
> CS> express export everything in this jar and nothing else. IIRC that was
> CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
> CS> jars.
>
> CS> tia
>
>
>
> --
> Peter Kriens                              Tel +33467542167
> 9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
> 34160 Beaulieu, France                    ICQ 255570717
> Skype pkriens                             Fax +1 8153772599
>
>


-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

Re: [bnd] Generating bundle from jar with only its contents

Posted by Peter Kriens <Pe...@aQute.biz>.
It is ok for bnd to not find the imports, you just do not get any
versions.

The bnd command line has a wrap command that seems to do what you
want.    http://www.aqute.biz/Code/Bnd

Kind regards,

     Peter Kriens

CS> This may be more a BND question, but here it goes

CS> Is there a way to generate a bundle that matches exactly the contents
CS> of a jar (besides the manifest of course)?

CS> For what I've seen so far you need to pass the whole classpath to BND
CS> so it can generate import headers with versions, and EXPORT_PACKAGE to
CS> tell it what packages you want. i'm looking for an easy way to to
CS> express export everything in this jar and nothing else. IIRC that was
CS> the way the osgi maven plugin worked, creating bundles 1 to 1 from
CS> jars.

CS> tia



-- 
Peter Kriens                              Tel +33467542167
9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
34160 Beaulieu, France                    ICQ 255570717
Skype pkriens                             Fax +1 8153772599