Re: [osgi-dev] Can bnd-export-maven-plugin resolve reactor modules?

2017-06-22 Thread Timothy Ward
It should be noted that it’s usually a good idea to have a configured resolve 
step performed by the bnd-resolver-maven-plugin. This allows you to do a 
resolve from the command line, and have those changes written back to the 
bndrun file. The resolve step in the export plugin, on the other hand, is best 
combined with the  option enabled. This way you have a 
verification step that runs in every build to ensure that the resolve result is 
sensible, but a manual command that you can run (i.e. not run by CI) used to 
make changes to the checked in source (the bndrun file).

Regards,

Tim


> On 22 Jun 2017, at 16:27, Raymond Auge  wrote:
> 
> I did forget the "resolve" step!
> 
> In the configuration of the maven plugin add:
> 
> true
> 
> - Ray
> 
> On Thu, Jun 22, 2017 at 9:56 AM, Mark Raynsford  > wrote:
> On 2017-06-21T18:32:35 -0400
> Raymond Auge > 
> wrote:
> >
> > 
> 
> 'Ello!
> 
> Thanks for the detailed instructions. I'll give this a go shortly.
> 
> M
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org 
> https://mail.osgi.org/mailman/listinfo/osgi-dev 
> 
> 
> 
> 
> -- 
> Raymond Augé  (@rotty3000)
> Senior Software Architect Liferay, Inc.  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Can bnd-export-maven-plugin resolve reactor modules?

2017-06-22 Thread Raymond Auge
I did forget the "resolve" step!

In the configuration of the maven plugin add:

true

- Ray

On Thu, Jun 22, 2017 at 9:56 AM, Mark Raynsford 
wrote:

> On 2017-06-21T18:32:35 -0400
> Raymond Auge  wrote:
> >
> > 
>
> 'Ello!
>
> Thanks for the detailed instructions. I'll give this a go shortly.
>
> M
>
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>



-- 
*Raymond Augé* 
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* 
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance  (@OSGiAlliance)
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Can bnd-export-maven-plugin resolve reactor modules?

2017-06-22 Thread Mark Raynsford
On 2017-06-21T18:32:35 -0400
Raymond Auge  wrote:
>
> 

'Ello!

Thanks for the detailed instructions. I'll give this a go shortly.

M


pgplEhBvfRuRv.pgp
Description: OpenPGP digital signature
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Help With OBR

2017-06-22 Thread Timothy Ward
Hi Eran

> On 22 Jun 2017, at 10:01, Eran Twili  wrote:
> 
> Thank you very much Peter and Tim, I’m sincerely grateful.
>  
> I know that automatic bundle generation from non-modular third party 
> libraries isn’t recommended and I assume I’ll find bundles of my 3rd parties 
> in public repositories. For any exceptional, I know my options (embed, 
> delegate, wrap). That isn’t my concern.
>  
> Indeed, we do want to keep working with maven, and prefer not to use 
> additional tools, if possible.
> If I understood you correctly, the entire OBR process can be manipulated with 
> just bnd maven plugins and a bndrun file.
>  
> To make sure I got the point:
> · I can use the indexer plugin to create indexes for my own 
> repositories, so that they will be OBR compatible.

Yes

> · I can then configure to use them, plus public repositories, in my 
> OBR process. (You mentioned maven central. Is it managing an index and can be 
> used by OBR?)

A qualified yes. There is no index of Maven Central (it would be so big and 
duplicative as to make it unusable). You can configure bnd to create a “view” 
of bundles from maven central, but this isn’t likely to give you the behaviour 
that you want (it’s usually used at build time in non-maven workspaces). More 
useful to you would probably be bnd’s ability to use a POM directly as input to 
the resolver, but at this point I would still recommend making an index as per 
the previous step.

> · I can then use the resolver plugin with a bndrun file that will 
> trigger the process of retrieving missing bundles (plus transitive 
> dependencies) from the repositories and will resolve my environment.

Yes

> · It will use the Equinox resolver, so the org.eclipse:osgi jar 
> should be in the classpath.

No. The resolver used will be the resolver included in the bnd plugin, so 
updating the version of the plugin may change the version of the resolver that 
is used. The embedded resolver is actually the Apache Felix resolver, which is 
the resolver used by Equinox, which may be the source of your confusion.

> · Does the fact that we embed OSGi inside wider (parent) application, 
> and so we lunch the OSGi FW programmatically (via EclipseStarter.startup), 
> change anything regarding the correctness of this approach (since here we’re 
> launching the FW differently, via bndrun)?

You will want to ensure that you configure the export plugin to gather your 
bundles (rather than creating a fat jar), and then put them wherever makes 
sense for your runtime. You will also want to create a platform definition 
describing your runtime’s base capabilities (i.e. the packages provided by your 
Equinox system bundle). There is a tool in bnd for generating this for you, 
although I haven’t used it. This platform definition will ensure that your 
bundles are resolved against the real embedded runtime, including any 
additional packages that you expose.

> · Finally, can I use the maven-bundle-plugin to do part (or all) of 
> the above, instead of the bnd maven plugins?

The maven bundle plugin allows you to create bundles (i.e. it is an alternative 
for the bnd-maven-plugin). It also offers some of the features of the 
bnd-baseline-maven-plugin. To my knowledge it does not support any of the 
indexer/resolver/export plugin features. If you choose to use the 
maven-bundle-plugin to generate your bundles then you can still use the other 
plugins to assemble your runtime (i.e. they’re all just OSGi bundles in the 
end).

Regards,

Tim

>  
>  
> Thanks a lot!
> Eran
>  
> From: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-boun...@mail.osgi.org] 
> On Behalf Of Timothy Ward
> Sent: Wednesday, June 21, 2017 5:22 PM
> To: OSGi Developer Mail List 
> Subject: Re: [osgi-dev] Help With OBR
>  
> For reference, the maven plugins to help with this are:
>  
>  
> The bnd-indexer-maven-plugin - used to create standard, portable XML 
> repository indexes for a set of POM dependencies
> The bnd-resolver-maven-plugin - used to convert a set of run requirements 
> into a list of bundles to use at runtime, uses one or more repository indexes 
> The bnd-export-maven-plugin - used to create a runnable jar containing an 
> OSGi framework and a list of bundles to install and start.
>  
> Documentation about these plugins is available at 
> https://github.com/bndtools/bnd/tree/master/maven 
> 
>  
> Regards,
>  
> Tim
>  
> On 21 Jun 2017, at 14:43, Peter Kriens  > wrote:
>  
> One of the things that make modularity provides its benefits is that your 
> modules are, eh, modules. Sadly, many third party libraries are not modules 
> because they do not manage their dependencies nor do they provide a clean 
> minimal API. So I would not get too excited about automatic bundle generation 
> from non-modular