You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by David Bosschaert <da...@gmail.com> on 2012/07/01 22:06:03 UTC

How to generate SUBSYSTEM.MF with maven?

Hi all,

I've playing with the current subsystems implementation and thanks to
John Ross fixing some bugs I've been able to get a subsystem with the
CXF-DOSGi functionality working :)

However, I've been thinking what the best way is to create a subsystem
in maven... My current impl has a few issues and maybe others have
some ideas how to improve:
1. My SUBSYSTEM.MF [1] needs to have the OSGi variant of the
${project.version} so it needs to translate 1.4.0-SNAPSHOT into
1.4.0.SNAPSHOT. Anyone know a way to do this?
2. The Subsystem-Content lists all the dependencies of the project.
However, because some of the bundles for this subsystem weren't
developed with OSGi in mind, the start ordering is significant. I
don't know of an easy way to generate this so currently it's hardcoded
and hence duplicated. Also note that fragments obviously don't have a
start-order.
3. In [2] I'm using the maven-assembly plugin to get all the
dependencies zipped up. However I need to have the .esa extension
whereas this plugin insists on .zip. I'm currently achieving that by
copying the .zip file to an .esa and then attaching the .esa to the
project but that's kinda wasteful as it puts both the .zip and the
.esa in the maven repo (and they're a couple of megs each).

2 above might be a bit hard to achieve in the short term, but 1 and 3
might be possible given the right amount of maven-fu?
I guess it would really be nice if there was a maven plugin that could
do all this ;)

Cheers,

David

[1] http://svn.apache.org/repos/asf/cxf/dosgi/trunk/distribution/subsystem/src/main/resources/OSGI-INF/SUBSYSTEM.MF
[2] http://svn.apache.org/repos/asf/cxf/dosgi/trunk/distribution/subsystem/pom.xml

Re: How to generate SUBSYSTEM.MF with maven?

Posted by Graham Charters <gc...@gmail.com>.
Oh, and I've just realized it won't do composite subsystems, because
it doesn't support the explicit import/export headers.

Regards, Graham.

On 20 July 2012 10:03, Graham Charters <gc...@gmail.com> wrote:
> I've just committed a first attempt at a esa-maven-plugin.  It largely
> does what the eba-maven-plugin does for OSGi Applications, but for
> Subsystems.  The implementation's based of the eba-maven-plugin.  I
> tidied things up a bit, removed deprecated configuration options, and
> added support for the Subsyste-Type header which doesn't exist for
> ebas.  There are a few things it doesn't support that it would be good
> to add:
> 1. Custom headers - in the <instructions> configuration element
> 2. Version ranges for the content dependencies (i'd thought about
> doing these based on maven dependency version ranges.  alternatively,
> we could just have a version policy configuration option that then
> calculates the ranges (e.g. fixed, minor, mjaor).
> 3. Start-order for contents (this should be relatively easy to add if
> based on the order of the dependencies (or at least the order they're
> presented to the mojo, which is hopefully the same)).
> 4. Probably a whole load of other features :)
>
> Please give it a try and let me know how it goes.  I'd suggest looking
> at the documentation for the eba-maven-plugin to get started.
>
> Regards, Graham.
>
> On 19 July 2012 12:57, Graham Charters <gc...@gmail.com> wrote:
>> Sorry, I missed this thread the first time round.  David is right, the
>> eba-maven-plugin is the best place to start.  It does also handle
>> versions using the shared maven2osgiconverter (also used by the bundle
>> plugin).
>>
>> I'll have a go at an esa-maven-plugin over the next few days.
>>
>> Regards, Graham.
>>
>> On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
>>> Hi,
>>>
>>> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
>>>
>>>> Hi Felix,
>>>>
>>>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>>>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>>>>>> 2. The Subsystem-Content lists all the dependencies of the project.
>>>>>> However, because some of the bundles for this subsystem weren't
>>>>>> developed with OSGi in mind, the start ordering is significant. I
>>>>>> don't know of an easy way to generate this so currently it's hardcoded
>>>>>> and hence duplicated. Also note that fragments obviously don't have a
>>>>>> start-order.
>>>>>
>>>>> Just wondering: How could start order be forced in OSGi ?
>>>>>
>>>>> IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.
>>>>
>>>> The start-order is an attribute defined in the Subsystems spec section
>>>> 134.12.1. It simply defines the order in which the bundles are started
>>>> within that subsystem.
>>>
>>> I see, thanks.
>>>
>>> Regards
>>> Felix

Re: How to generate SUBSYSTEM.MF with maven?

Posted by David Bosschaert <da...@gmail.com>.
Great stuff, many thanks Graham!

David

On 31 July 2012 11:27, Graham Charters <gc...@gmail.com> wrote:
> Hi David,  I've just committed some changes to add basic start-order
> support.  If you put the following in the plugin configuration, it
> should work (or do something :S )
>
>           <startOrder>dependencies</startOrder>
>
> Let me know how you get on.
>
> Regards, Graham.
>
>
> On 20 July 2012 17:21, John W Ross <jw...@us.ibm.com> wrote:
>> Support for service dependencies still needs to be added. Also, some
>> performance work needs to be done, particularly around the repository
>> implementations. I'm not sure these are reasons not to include it in the
>> build, however, and I am not against the idea. I think we may also want to
>> hear status from Mark, who was working on bulking up the itests project
>> (e.g., is everything currently passing?).
>>
>> John
>>
>>> Graham Charters <gc...@gmail.com>
>>> 07/20/2012 08:00 AM
>>>
>>> Please respond to
>>> user@aries.apache.org
>>>
>>> To
>>>
>>> user@aries.apache.org,
>>>
>>> cc
>>>
>>> Subject
>>>
>>> Re: How to generate SUBSYSTEM.MF with maven?
>>
>>
>>>
>>> I'd like to hear John's thoughts on Subsystem's being hooked in, but
>>> given where I believe it is, I would be in favour of doing that.
>>>
>>> Regarding the esa-maven-plugin, I think it's relatively harmless, so
>>> could be hooked in.  Maybe we should let someone give it a try first?
>>>
>>> Regards, Graham.
>>>
>>> On 20 July 2012 13:21, David Bosschaert <da...@gmail.com>
>>> wrote:
>>> > Thanks Graham, I'll have a look at it soon.
>>> >
>>> > David
>>> >
>>> > On 20 July 2012 11:11, Holly Cummins <ho...@googlemail.com>
>>> > wrote:
>>> >> Cool! That will be really useful. Do you think it - and the rest of
>>> >> the subsystems stuff, in fact - should be hooked into the main build?
>>> >>
>>> >> Holly
>>> >>
>>> >> On Fri, Jul 20, 2012 at 10:03 AM, Graham Charters
>>> <gc...@gmail.com> wrote:
>>> >>> I've just committed a first attempt at a esa-maven-plugin.  It largely
>>> >>> does what the eba-maven-plugin does for OSGi Applications, but for
>>> >>> Subsystems.  The implementation's based of the eba-maven-plugin.  I
>>> >>> tidied things up a bit, removed deprecated configuration options, and
>>> >>> added support for the Subsyste-Type header which doesn't exist for
>>> >>> ebas.  There are a few things it doesn't support that it would be good
>>> >>> to add:
>>> >>> 1. Custom headers - in the <instructions> configuration element
>>> >>> 2. Version ranges for the content dependencies (i'd thought about
>>> >>> doing these based on maven dependency version ranges.  alternatively,
>>> >>> we could just have a version policy configuration option that then
>>> >>> calculates the ranges (e.g. fixed, minor, mjaor).
>>> >>> 3. Start-order for contents (this should be relatively easy to add if
>>> >>> based on the order of the dependencies (or at least the order they're
>>> >>> presented to the mojo, which is hopefully the same)).
>>> >>> 4. Probably a whole load of other features :)
>>> >>>
>>> >>> Please give it a try and let me know how it goes.  I'd suggest looking
>>> >>> at the documentation for the eba-maven-plugin to get started.
>>> >>>
>>> >>> Regards, Graham.
>>> >>>
>>> >>> On 19 July 2012 12:57, Graham Charters <gc...@gmail.com> wrote:
>>> >>>> Sorry, I missed this thread the first time round.  David is right,
>>> >>>> the
>>> >>>> eba-maven-plugin is the best place to start.  It does also handle
>>> >>>> versions using the shared maven2osgiconverter (also used by the
>>> >>>> bundle
>>> >>>> plugin).
>>> >>>>
>>> >>>> I'll have a go at an esa-maven-plugin over the next few days.
>>> >>>>
>>> >>>> Regards, Graham.
>>> >>>>
>>> >>>> On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
>>> >>>>> Hi,
>>> >>>>>
>>> >>>>> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
>>> >>>>>
>>> >>>>>> Hi Felix,
>>> >>>>>>
>>> >>>>>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>>> >>>>>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>>> >>>>>>>> 2. The Subsystem-Content lists all the dependencies of the
>>> >>>>>>>> project.
>>> >>>>>>>> However, because some of the bundles for this subsystem weren't
>>> >>>>>>>> developed with OSGi in mind, the start ordering is significant. I
>>> >>>>>>>> don't know of an easy way to generate this so currently
>>> it's hardcoded
>>> >>>>>>>> and hence duplicated. Also note that fragments obviously don't
>>> >>>>>>>> have a
>>> >>>>>>>> start-order.
>>> >>>>>>>
>>> >>>>>>> Just wondering: How could start order be forced in OSGi ?
>>> >>>>>>>
>>> >>>>>>> IIRC there is no such thing as start ordering because such
>>> an order can never be guaranteed -- start levels only help to a
>>> certain degree.
>>> >>>>>>
>>> >>>>>> The start-order is an attribute defined in the Subsystems spec
>>> >>>>>> section
>>> >>>>>> 134.12.1. It simply defines the order in which the bundles are
>>> >>>>>> started
>>> >>>>>> within that subsystem.
>>> >>>>>
>>> >>>>> I see, thanks.
>>> >>>>>
>>> >>>>> Regards
>>> >>>>> Felix
>>>

Re: How to generate SUBSYSTEM.MF with maven?

Posted by Graham Charters <gc...@gmail.com>.
Hi David,  I've just committed some changes to add basic start-order
support.  If you put the following in the plugin configuration, it
should work (or do something :S )

          <startOrder>dependencies</startOrder>

Let me know how you get on.

Regards, Graham.


On 20 July 2012 17:21, John W Ross <jw...@us.ibm.com> wrote:
> Support for service dependencies still needs to be added. Also, some
> performance work needs to be done, particularly around the repository
> implementations. I'm not sure these are reasons not to include it in the
> build, however, and I am not against the idea. I think we may also want to
> hear status from Mark, who was working on bulking up the itests project
> (e.g., is everything currently passing?).
>
> John
>
>> Graham Charters <gc...@gmail.com>
>> 07/20/2012 08:00 AM
>>
>> Please respond to
>> user@aries.apache.org
>>
>> To
>>
>> user@aries.apache.org,
>>
>> cc
>>
>> Subject
>>
>> Re: How to generate SUBSYSTEM.MF with maven?
>
>
>>
>> I'd like to hear John's thoughts on Subsystem's being hooked in, but
>> given where I believe it is, I would be in favour of doing that.
>>
>> Regarding the esa-maven-plugin, I think it's relatively harmless, so
>> could be hooked in.  Maybe we should let someone give it a try first?
>>
>> Regards, Graham.
>>
>> On 20 July 2012 13:21, David Bosschaert <da...@gmail.com>
>> wrote:
>> > Thanks Graham, I'll have a look at it soon.
>> >
>> > David
>> >
>> > On 20 July 2012 11:11, Holly Cummins <ho...@googlemail.com>
>> > wrote:
>> >> Cool! That will be really useful. Do you think it - and the rest of
>> >> the subsystems stuff, in fact - should be hooked into the main build?
>> >>
>> >> Holly
>> >>
>> >> On Fri, Jul 20, 2012 at 10:03 AM, Graham Charters
>> <gc...@gmail.com> wrote:
>> >>> I've just committed a first attempt at a esa-maven-plugin.  It largely
>> >>> does what the eba-maven-plugin does for OSGi Applications, but for
>> >>> Subsystems.  The implementation's based of the eba-maven-plugin.  I
>> >>> tidied things up a bit, removed deprecated configuration options, and
>> >>> added support for the Subsyste-Type header which doesn't exist for
>> >>> ebas.  There are a few things it doesn't support that it would be good
>> >>> to add:
>> >>> 1. Custom headers - in the <instructions> configuration element
>> >>> 2. Version ranges for the content dependencies (i'd thought about
>> >>> doing these based on maven dependency version ranges.  alternatively,
>> >>> we could just have a version policy configuration option that then
>> >>> calculates the ranges (e.g. fixed, minor, mjaor).
>> >>> 3. Start-order for contents (this should be relatively easy to add if
>> >>> based on the order of the dependencies (or at least the order they're
>> >>> presented to the mojo, which is hopefully the same)).
>> >>> 4. Probably a whole load of other features :)
>> >>>
>> >>> Please give it a try and let me know how it goes.  I'd suggest looking
>> >>> at the documentation for the eba-maven-plugin to get started.
>> >>>
>> >>> Regards, Graham.
>> >>>
>> >>> On 19 July 2012 12:57, Graham Charters <gc...@gmail.com> wrote:
>> >>>> Sorry, I missed this thread the first time round.  David is right,
>> >>>> the
>> >>>> eba-maven-plugin is the best place to start.  It does also handle
>> >>>> versions using the shared maven2osgiconverter (also used by the
>> >>>> bundle
>> >>>> plugin).
>> >>>>
>> >>>> I'll have a go at an esa-maven-plugin over the next few days.
>> >>>>
>> >>>> Regards, Graham.
>> >>>>
>> >>>> On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
>> >>>>> Hi,
>> >>>>>
>> >>>>> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
>> >>>>>
>> >>>>>> Hi Felix,
>> >>>>>>
>> >>>>>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>> >>>>>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>> >>>>>>>> 2. The Subsystem-Content lists all the dependencies of the
>> >>>>>>>> project.
>> >>>>>>>> However, because some of the bundles for this subsystem weren't
>> >>>>>>>> developed with OSGi in mind, the start ordering is significant. I
>> >>>>>>>> don't know of an easy way to generate this so currently
>> it's hardcoded
>> >>>>>>>> and hence duplicated. Also note that fragments obviously don't
>> >>>>>>>> have a
>> >>>>>>>> start-order.
>> >>>>>>>
>> >>>>>>> Just wondering: How could start order be forced in OSGi ?
>> >>>>>>>
>> >>>>>>> IIRC there is no such thing as start ordering because such
>> an order can never be guaranteed -- start levels only help to a
>> certain degree.
>> >>>>>>
>> >>>>>> The start-order is an attribute defined in the Subsystems spec
>> >>>>>> section
>> >>>>>> 134.12.1. It simply defines the order in which the bundles are
>> >>>>>> started
>> >>>>>> within that subsystem.
>> >>>>>
>> >>>>> I see, thanks.
>> >>>>>
>> >>>>> Regards
>> >>>>> Felix
>>

Re: How to generate SUBSYSTEM.MF with maven?

Posted by John W Ross <jw...@us.ibm.com>.
Support for service dependencies still needs to be added. Also, some
performance work needs to be done, particularly around the repository
implementations. I'm not sure these are reasons not to include it in the
build, however, and I am not against the idea. I think we may also want to
hear status from Mark, who was working on bulking up the itests project
(e.g., is everything currently passing?).

John

> Graham Charters <gc...@gmail.com>
> 07/20/2012 08:00 AM
>
> Please respond to
> user@aries.apache.org
>
> To
>
> user@aries.apache.org,
>
> cc
>
> Subject
>
> Re: How to generate SUBSYSTEM.MF with maven?
>
> I'd like to hear John's thoughts on Subsystem's being hooked in, but
> given where I believe it is, I would be in favour of doing that.
>
> Regarding the esa-maven-plugin, I think it's relatively harmless, so
> could be hooked in.  Maybe we should let someone give it a try first?
>
> Regards, Graham.
>
> On 20 July 2012 13:21, David Bosschaert <da...@gmail.com>
wrote:
> > Thanks Graham, I'll have a look at it soon.
> >
> > David
> >
> > On 20 July 2012 11:11, Holly Cummins <ho...@googlemail.com>
wrote:
> >> Cool! That will be really useful. Do you think it - and the rest of
> >> the subsystems stuff, in fact - should be hooked into the main build?
> >>
> >> Holly
> >>
> >> On Fri, Jul 20, 2012 at 10:03 AM, Graham Charters
> <gc...@gmail.com> wrote:
> >>> I've just committed a first attempt at a esa-maven-plugin.  It
largely
> >>> does what the eba-maven-plugin does for OSGi Applications, but for
> >>> Subsystems.  The implementation's based of the eba-maven-plugin.  I
> >>> tidied things up a bit, removed deprecated configuration options, and
> >>> added support for the Subsyste-Type header which doesn't exist for
> >>> ebas.  There are a few things it doesn't support that it would be
good
> >>> to add:
> >>> 1. Custom headers - in the <instructions> configuration element
> >>> 2. Version ranges for the content dependencies (i'd thought about
> >>> doing these based on maven dependency version ranges.  alternatively,
> >>> we could just have a version policy configuration option that then
> >>> calculates the ranges (e.g. fixed, minor, mjaor).
> >>> 3. Start-order for contents (this should be relatively easy to add if
> >>> based on the order of the dependencies (or at least the order they're
> >>> presented to the mojo, which is hopefully the same)).
> >>> 4. Probably a whole load of other features :)
> >>>
> >>> Please give it a try and let me know how it goes.  I'd suggest
looking
> >>> at the documentation for the eba-maven-plugin to get started.
> >>>
> >>> Regards, Graham.
> >>>
> >>> On 19 July 2012 12:57, Graham Charters <gc...@gmail.com> wrote:
> >>>> Sorry, I missed this thread the first time round.  David is right,
the
> >>>> eba-maven-plugin is the best place to start.  It does also handle
> >>>> versions using the shared maven2osgiconverter (also used by the
bundle
> >>>> plugin).
> >>>>
> >>>> I'll have a go at an esa-maven-plugin over the next few days.
> >>>>
> >>>> Regards, Graham.
> >>>>
> >>>> On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
> >>>>> Hi,
> >>>>>
> >>>>> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
> >>>>>
> >>>>>> Hi Felix,
> >>>>>>
> >>>>>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com>
wrote:
> >>>>>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
> >>>>>>>> 2. The Subsystem-Content lists all the dependencies of the
project.
> >>>>>>>> However, because some of the bundles for this subsystem weren't
> >>>>>>>> developed with OSGi in mind, the start ordering is significant.
I
> >>>>>>>> don't know of an easy way to generate this so currently
> it's hardcoded
> >>>>>>>> and hence duplicated. Also note that fragments obviously don't
have a
> >>>>>>>> start-order.
> >>>>>>>
> >>>>>>> Just wondering: How could start order be forced in OSGi ?
> >>>>>>>
> >>>>>>> IIRC there is no such thing as start ordering because such
> an order can never be guaranteed -- start levels only help to a
> certain degree.
> >>>>>>
> >>>>>> The start-order is an attribute defined in the Subsystems spec
section
> >>>>>> 134.12.1. It simply defines the order in which the bundles are
started
> >>>>>> within that subsystem.
> >>>>>
> >>>>> I see, thanks.
> >>>>>
> >>>>> Regards
> >>>>> Felix
>

Re: How to generate SUBSYSTEM.MF with maven?

Posted by David Bosschaert <da...@gmail.com>.
Hi Graham,

On 20 July 2012 16:51, Graham Charters <gc...@gmail.com> wrote:
> On 20 July 2012 15:06, David Bosschaert <da...@gmail.com> >> * I found the following in the integration test:
>> <extensions>true</extensions>
>> <configuration>
>>   <includeJar>false</includeJar>
>> </configuration>
>> And am curious what the above configuration does. Or is it a leftover
>> from the maven-bundle-plugin?
>
> These are leftovers (not sure which plugin the originally came from).
> I removed includeJar support from esa (it's in eba, just has not
> purpose being there, IMO).  I'd not really looked in this dusty corner
> of the plugin, having focused on the unit tests.  It appears that this
> strange integration test is not actually run and I would propose we
> delete it.

Ah - ok. I guess it would be good to add an integration test back in
at some point...

>> * One pedantic comment: The integration test has version 1.0. You
>> probably don't want that given that this isn't a release. BTW why is
>> it called it0070?
>>
>
> Have you got something against the number 70? ;)  I think this whole
> 'test' needs deleting.

I was wondering what you did with the other 69 tests ;-)

>> And yes, overriding headers and specifying start-orders would be
>> awesome, in fact I can't use it for my CXF-DOSGi subsystem until
>> start-orders are supported...
>>
>
> Not sure when I'll get to any of these updates, but will try to pick
> them off when I can.  I won't be offended if others get to them first.
> :)

Great - looking forward to it!

Have a nice weekend,

David

Re: How to generate SUBSYSTEM.MF with maven?

Posted by Graham Charters <gc...@gmail.com>.
Hi David, I've inlined some responses, below.

Regards, Graham.

On 20 July 2012 15:06, David Bosschaert <da...@gmail.com> wrote:
> Hi Graham,
>
> I played with it for a little while, and first of all: nice work :)
>
> But I do have some comments/requests/questions:
>
> I used the integration test combined with the eba-maven-plugin docpage
> as my documentation assuming that no documentation is available yet.
>
> * I found the following in the integration test:
> <extensions>true</extensions>
> <configuration>
>   <includeJar>false</includeJar>
> </configuration>
> And am curious what the above configuration does. Or is it a leftover
> from the maven-bundle-plugin?

These are leftovers (not sure which plugin the originally came from).
I removed includeJar support from esa (it's in eba, just has not
purpose being there, IMO).  I'd not really looked in this dusty corner
of the plugin, having focused on the unit tests.  It appears that this
strange integration test is not actually run and I would propose we
delete it.

> * <subsystemManifestFile>src/main/custom/SUBSYSTEM.MF</subsystemManifestFile>
> Why not use the maven convention way of things. Let's say if there is
> a SUBSYSTEM.MF in src/main/esa/OSGI-INF/SUBSYSTEM.MF it will be
> used...

I think that's a good idea.

> * I didn't specify a Description in my pom, which resulted in
> Subsystem-Description: null
> in the SUBSYSTEM.MF. Better to omit it I would say :)

Yuck.. Agreed.

> * One pedantic comment: The integration test has version 1.0. You
> probably don't want that given that this isn't a release. BTW why is
> it called it0070?
>

Have you got something against the number 70? ;)  I think this whole
'test' needs deleting.

> And yes, overriding headers and specifying start-orders would be
> awesome, in fact I can't use it for my CXF-DOSGi subsystem until
> start-orders are supported...
>

Not sure when I'll get to any of these updates, but will try to pick
them off when I can.  I won't be offended if others get to them first.
:)


> Thanks!
>
> David
>
>
> On 20 July 2012 14:00, Graham Charters <gc...@gmail.com> wrote:
>> I'd like to hear John's thoughts on Subsystem's being hooked in, but
>> given where I believe it is, I would be in favour of doing that.
>>
>> Regarding the esa-maven-plugin, I think it's relatively harmless, so
>> could be hooked in.  Maybe we should let someone give it a try first?
>>
>> Regards, Graham.
>>
>> On 20 July 2012 13:21, David Bosschaert <da...@gmail.com> wrote:
>>> Thanks Graham, I'll have a look at it soon.
>>>
>>> David
>>>
>>> On 20 July 2012 11:11, Holly Cummins <ho...@googlemail.com> wrote:
>>>> Cool! That will be really useful. Do you think it - and the rest of
>>>> the subsystems stuff, in fact - should be hooked into the main build?
>>>>
>>>> Holly
>>>>
>>>> On Fri, Jul 20, 2012 at 10:03 AM, Graham Charters <gc...@gmail.com> wrote:
>>>>> I've just committed a first attempt at a esa-maven-plugin.  It largely
>>>>> does what the eba-maven-plugin does for OSGi Applications, but for
>>>>> Subsystems.  The implementation's based of the eba-maven-plugin.  I
>>>>> tidied things up a bit, removed deprecated configuration options, and
>>>>> added support for the Subsyste-Type header which doesn't exist for
>>>>> ebas.  There are a few things it doesn't support that it would be good
>>>>> to add:
>>>>> 1. Custom headers - in the <instructions> configuration element
>>>>> 2. Version ranges for the content dependencies (i'd thought about
>>>>> doing these based on maven dependency version ranges.  alternatively,
>>>>> we could just have a version policy configuration option that then
>>>>> calculates the ranges (e.g. fixed, minor, mjaor).
>>>>> 3. Start-order for contents (this should be relatively easy to add if
>>>>> based on the order of the dependencies (or at least the order they're
>>>>> presented to the mojo, which is hopefully the same)).
>>>>> 4. Probably a whole load of other features :)
>>>>>
>>>>> Please give it a try and let me know how it goes.  I'd suggest looking
>>>>> at the documentation for the eba-maven-plugin to get started.
>>>>>
>>>>> Regards, Graham.
>>>>>
>>>>> On 19 July 2012 12:57, Graham Charters <gc...@gmail.com> wrote:
>>>>>> Sorry, I missed this thread the first time round.  David is right, the
>>>>>> eba-maven-plugin is the best place to start.  It does also handle
>>>>>> versions using the shared maven2osgiconverter (also used by the bundle
>>>>>> plugin).
>>>>>>
>>>>>> I'll have a go at an esa-maven-plugin over the next few days.
>>>>>>
>>>>>> Regards, Graham.
>>>>>>
>>>>>> On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
>>>>>>>
>>>>>>>> Hi Felix,
>>>>>>>>
>>>>>>>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>>>>>>>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>>>>>>>>>> 2. The Subsystem-Content lists all the dependencies of the project.
>>>>>>>>>> However, because some of the bundles for this subsystem weren't
>>>>>>>>>> developed with OSGi in mind, the start ordering is significant. I
>>>>>>>>>> don't know of an easy way to generate this so currently it's hardcoded
>>>>>>>>>> and hence duplicated. Also note that fragments obviously don't have a
>>>>>>>>>> start-order.
>>>>>>>>>
>>>>>>>>> Just wondering: How could start order be forced in OSGi ?
>>>>>>>>>
>>>>>>>>> IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.
>>>>>>>>
>>>>>>>> The start-order is an attribute defined in the Subsystems spec section
>>>>>>>> 134.12.1. It simply defines the order in which the bundles are started
>>>>>>>> within that subsystem.
>>>>>>>
>>>>>>> I see, thanks.
>>>>>>>
>>>>>>> Regards
>>>>>>> Felix

Re: How to generate SUBSYSTEM.MF with maven?

Posted by David Bosschaert <da...@gmail.com>.
Hi Graham,

I played with it for a little while, and first of all: nice work :)

But I do have some comments/requests/questions:

I used the integration test combined with the eba-maven-plugin docpage
as my documentation assuming that no documentation is available yet.

* I found the following in the integration test:
<extensions>true</extensions>
<configuration>
  <includeJar>false</includeJar>
</configuration>
And am curious what the above configuration does. Or is it a leftover
from the maven-bundle-plugin?
* <subsystemManifestFile>src/main/custom/SUBSYSTEM.MF</subsystemManifestFile>
Why not use the maven convention way of things. Let's say if there is
a SUBSYSTEM.MF in src/main/esa/OSGI-INF/SUBSYSTEM.MF it will be
used...
* I didn't specify a Description in my pom, which resulted in
Subsystem-Description: null
in the SUBSYSTEM.MF. Better to omit it I would say :)
* One pedantic comment: The integration test has version 1.0. You
probably don't want that given that this isn't a release. BTW why is
it called it0070?

And yes, overriding headers and specifying start-orders would be
awesome, in fact I can't use it for my CXF-DOSGi subsystem until
start-orders are supported...

Thanks!

David


On 20 July 2012 14:00, Graham Charters <gc...@gmail.com> wrote:
> I'd like to hear John's thoughts on Subsystem's being hooked in, but
> given where I believe it is, I would be in favour of doing that.
>
> Regarding the esa-maven-plugin, I think it's relatively harmless, so
> could be hooked in.  Maybe we should let someone give it a try first?
>
> Regards, Graham.
>
> On 20 July 2012 13:21, David Bosschaert <da...@gmail.com> wrote:
>> Thanks Graham, I'll have a look at it soon.
>>
>> David
>>
>> On 20 July 2012 11:11, Holly Cummins <ho...@googlemail.com> wrote:
>>> Cool! That will be really useful. Do you think it - and the rest of
>>> the subsystems stuff, in fact - should be hooked into the main build?
>>>
>>> Holly
>>>
>>> On Fri, Jul 20, 2012 at 10:03 AM, Graham Charters <gc...@gmail.com> wrote:
>>>> I've just committed a first attempt at a esa-maven-plugin.  It largely
>>>> does what the eba-maven-plugin does for OSGi Applications, but for
>>>> Subsystems.  The implementation's based of the eba-maven-plugin.  I
>>>> tidied things up a bit, removed deprecated configuration options, and
>>>> added support for the Subsyste-Type header which doesn't exist for
>>>> ebas.  There are a few things it doesn't support that it would be good
>>>> to add:
>>>> 1. Custom headers - in the <instructions> configuration element
>>>> 2. Version ranges for the content dependencies (i'd thought about
>>>> doing these based on maven dependency version ranges.  alternatively,
>>>> we could just have a version policy configuration option that then
>>>> calculates the ranges (e.g. fixed, minor, mjaor).
>>>> 3. Start-order for contents (this should be relatively easy to add if
>>>> based on the order of the dependencies (or at least the order they're
>>>> presented to the mojo, which is hopefully the same)).
>>>> 4. Probably a whole load of other features :)
>>>>
>>>> Please give it a try and let me know how it goes.  I'd suggest looking
>>>> at the documentation for the eba-maven-plugin to get started.
>>>>
>>>> Regards, Graham.
>>>>
>>>> On 19 July 2012 12:57, Graham Charters <gc...@gmail.com> wrote:
>>>>> Sorry, I missed this thread the first time round.  David is right, the
>>>>> eba-maven-plugin is the best place to start.  It does also handle
>>>>> versions using the shared maven2osgiconverter (also used by the bundle
>>>>> plugin).
>>>>>
>>>>> I'll have a go at an esa-maven-plugin over the next few days.
>>>>>
>>>>> Regards, Graham.
>>>>>
>>>>> On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
>>>>>>
>>>>>>> Hi Felix,
>>>>>>>
>>>>>>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>>>>>>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>>>>>>>>> 2. The Subsystem-Content lists all the dependencies of the project.
>>>>>>>>> However, because some of the bundles for this subsystem weren't
>>>>>>>>> developed with OSGi in mind, the start ordering is significant. I
>>>>>>>>> don't know of an easy way to generate this so currently it's hardcoded
>>>>>>>>> and hence duplicated. Also note that fragments obviously don't have a
>>>>>>>>> start-order.
>>>>>>>>
>>>>>>>> Just wondering: How could start order be forced in OSGi ?
>>>>>>>>
>>>>>>>> IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.
>>>>>>>
>>>>>>> The start-order is an attribute defined in the Subsystems spec section
>>>>>>> 134.12.1. It simply defines the order in which the bundles are started
>>>>>>> within that subsystem.
>>>>>>
>>>>>> I see, thanks.
>>>>>>
>>>>>> Regards
>>>>>> Felix

Re: How to generate SUBSYSTEM.MF with maven?

Posted by Graham Charters <gc...@gmail.com>.
I'd like to hear John's thoughts on Subsystem's being hooked in, but
given where I believe it is, I would be in favour of doing that.

Regarding the esa-maven-plugin, I think it's relatively harmless, so
could be hooked in.  Maybe we should let someone give it a try first?

Regards, Graham.

On 20 July 2012 13:21, David Bosschaert <da...@gmail.com> wrote:
> Thanks Graham, I'll have a look at it soon.
>
> David
>
> On 20 July 2012 11:11, Holly Cummins <ho...@googlemail.com> wrote:
>> Cool! That will be really useful. Do you think it - and the rest of
>> the subsystems stuff, in fact - should be hooked into the main build?
>>
>> Holly
>>
>> On Fri, Jul 20, 2012 at 10:03 AM, Graham Charters <gc...@gmail.com> wrote:
>>> I've just committed a first attempt at a esa-maven-plugin.  It largely
>>> does what the eba-maven-plugin does for OSGi Applications, but for
>>> Subsystems.  The implementation's based of the eba-maven-plugin.  I
>>> tidied things up a bit, removed deprecated configuration options, and
>>> added support for the Subsyste-Type header which doesn't exist for
>>> ebas.  There are a few things it doesn't support that it would be good
>>> to add:
>>> 1. Custom headers - in the <instructions> configuration element
>>> 2. Version ranges for the content dependencies (i'd thought about
>>> doing these based on maven dependency version ranges.  alternatively,
>>> we could just have a version policy configuration option that then
>>> calculates the ranges (e.g. fixed, minor, mjaor).
>>> 3. Start-order for contents (this should be relatively easy to add if
>>> based on the order of the dependencies (or at least the order they're
>>> presented to the mojo, which is hopefully the same)).
>>> 4. Probably a whole load of other features :)
>>>
>>> Please give it a try and let me know how it goes.  I'd suggest looking
>>> at the documentation for the eba-maven-plugin to get started.
>>>
>>> Regards, Graham.
>>>
>>> On 19 July 2012 12:57, Graham Charters <gc...@gmail.com> wrote:
>>>> Sorry, I missed this thread the first time round.  David is right, the
>>>> eba-maven-plugin is the best place to start.  It does also handle
>>>> versions using the shared maven2osgiconverter (also used by the bundle
>>>> plugin).
>>>>
>>>> I'll have a go at an esa-maven-plugin over the next few days.
>>>>
>>>> Regards, Graham.
>>>>
>>>> On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
>>>>> Hi,
>>>>>
>>>>> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
>>>>>
>>>>>> Hi Felix,
>>>>>>
>>>>>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>>>>>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>>>>>>>> 2. The Subsystem-Content lists all the dependencies of the project.
>>>>>>>> However, because some of the bundles for this subsystem weren't
>>>>>>>> developed with OSGi in mind, the start ordering is significant. I
>>>>>>>> don't know of an easy way to generate this so currently it's hardcoded
>>>>>>>> and hence duplicated. Also note that fragments obviously don't have a
>>>>>>>> start-order.
>>>>>>>
>>>>>>> Just wondering: How could start order be forced in OSGi ?
>>>>>>>
>>>>>>> IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.
>>>>>>
>>>>>> The start-order is an attribute defined in the Subsystems spec section
>>>>>> 134.12.1. It simply defines the order in which the bundles are started
>>>>>> within that subsystem.
>>>>>
>>>>> I see, thanks.
>>>>>
>>>>> Regards
>>>>> Felix

Re: How to generate SUBSYSTEM.MF with maven?

Posted by David Bosschaert <da...@gmail.com>.
Thanks Graham, I'll have a look at it soon.

David

On 20 July 2012 11:11, Holly Cummins <ho...@googlemail.com> wrote:
> Cool! That will be really useful. Do you think it - and the rest of
> the subsystems stuff, in fact - should be hooked into the main build?
>
> Holly
>
> On Fri, Jul 20, 2012 at 10:03 AM, Graham Charters <gc...@gmail.com> wrote:
>> I've just committed a first attempt at a esa-maven-plugin.  It largely
>> does what the eba-maven-plugin does for OSGi Applications, but for
>> Subsystems.  The implementation's based of the eba-maven-plugin.  I
>> tidied things up a bit, removed deprecated configuration options, and
>> added support for the Subsyste-Type header which doesn't exist for
>> ebas.  There are a few things it doesn't support that it would be good
>> to add:
>> 1. Custom headers - in the <instructions> configuration element
>> 2. Version ranges for the content dependencies (i'd thought about
>> doing these based on maven dependency version ranges.  alternatively,
>> we could just have a version policy configuration option that then
>> calculates the ranges (e.g. fixed, minor, mjaor).
>> 3. Start-order for contents (this should be relatively easy to add if
>> based on the order of the dependencies (or at least the order they're
>> presented to the mojo, which is hopefully the same)).
>> 4. Probably a whole load of other features :)
>>
>> Please give it a try and let me know how it goes.  I'd suggest looking
>> at the documentation for the eba-maven-plugin to get started.
>>
>> Regards, Graham.
>>
>> On 19 July 2012 12:57, Graham Charters <gc...@gmail.com> wrote:
>>> Sorry, I missed this thread the first time round.  David is right, the
>>> eba-maven-plugin is the best place to start.  It does also handle
>>> versions using the shared maven2osgiconverter (also used by the bundle
>>> plugin).
>>>
>>> I'll have a go at an esa-maven-plugin over the next few days.
>>>
>>> Regards, Graham.
>>>
>>> On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
>>>>
>>>>> Hi Felix,
>>>>>
>>>>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>>>>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>>>>>>> 2. The Subsystem-Content lists all the dependencies of the project.
>>>>>>> However, because some of the bundles for this subsystem weren't
>>>>>>> developed with OSGi in mind, the start ordering is significant. I
>>>>>>> don't know of an easy way to generate this so currently it's hardcoded
>>>>>>> and hence duplicated. Also note that fragments obviously don't have a
>>>>>>> start-order.
>>>>>>
>>>>>> Just wondering: How could start order be forced in OSGi ?
>>>>>>
>>>>>> IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.
>>>>>
>>>>> The start-order is an attribute defined in the Subsystems spec section
>>>>> 134.12.1. It simply defines the order in which the bundles are started
>>>>> within that subsystem.
>>>>
>>>> I see, thanks.
>>>>
>>>> Regards
>>>> Felix

Re: How to generate SUBSYSTEM.MF with maven?

Posted by Holly Cummins <ho...@googlemail.com>.
Cool! That will be really useful. Do you think it - and the rest of
the subsystems stuff, in fact - should be hooked into the main build?

Holly

On Fri, Jul 20, 2012 at 10:03 AM, Graham Charters <gc...@gmail.com> wrote:
> I've just committed a first attempt at a esa-maven-plugin.  It largely
> does what the eba-maven-plugin does for OSGi Applications, but for
> Subsystems.  The implementation's based of the eba-maven-plugin.  I
> tidied things up a bit, removed deprecated configuration options, and
> added support for the Subsyste-Type header which doesn't exist for
> ebas.  There are a few things it doesn't support that it would be good
> to add:
> 1. Custom headers - in the <instructions> configuration element
> 2. Version ranges for the content dependencies (i'd thought about
> doing these based on maven dependency version ranges.  alternatively,
> we could just have a version policy configuration option that then
> calculates the ranges (e.g. fixed, minor, mjaor).
> 3. Start-order for contents (this should be relatively easy to add if
> based on the order of the dependencies (or at least the order they're
> presented to the mojo, which is hopefully the same)).
> 4. Probably a whole load of other features :)
>
> Please give it a try and let me know how it goes.  I'd suggest looking
> at the documentation for the eba-maven-plugin to get started.
>
> Regards, Graham.
>
> On 19 July 2012 12:57, Graham Charters <gc...@gmail.com> wrote:
>> Sorry, I missed this thread the first time round.  David is right, the
>> eba-maven-plugin is the best place to start.  It does also handle
>> versions using the shared maven2osgiconverter (also used by the bundle
>> plugin).
>>
>> I'll have a go at an esa-maven-plugin over the next few days.
>>
>> Regards, Graham.
>>
>> On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
>>> Hi,
>>>
>>> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
>>>
>>>> Hi Felix,
>>>>
>>>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>>>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>>>>>> 2. The Subsystem-Content lists all the dependencies of the project.
>>>>>> However, because some of the bundles for this subsystem weren't
>>>>>> developed with OSGi in mind, the start ordering is significant. I
>>>>>> don't know of an easy way to generate this so currently it's hardcoded
>>>>>> and hence duplicated. Also note that fragments obviously don't have a
>>>>>> start-order.
>>>>>
>>>>> Just wondering: How could start order be forced in OSGi ?
>>>>>
>>>>> IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.
>>>>
>>>> The start-order is an attribute defined in the Subsystems spec section
>>>> 134.12.1. It simply defines the order in which the bundles are started
>>>> within that subsystem.
>>>
>>> I see, thanks.
>>>
>>> Regards
>>> Felix

Re: How to generate SUBSYSTEM.MF with maven?

Posted by Graham Charters <gc...@gmail.com>.
I've just committed a first attempt at a esa-maven-plugin.  It largely
does what the eba-maven-plugin does for OSGi Applications, but for
Subsystems.  The implementation's based of the eba-maven-plugin.  I
tidied things up a bit, removed deprecated configuration options, and
added support for the Subsyste-Type header which doesn't exist for
ebas.  There are a few things it doesn't support that it would be good
to add:
1. Custom headers - in the <instructions> configuration element
2. Version ranges for the content dependencies (i'd thought about
doing these based on maven dependency version ranges.  alternatively,
we could just have a version policy configuration option that then
calculates the ranges (e.g. fixed, minor, mjaor).
3. Start-order for contents (this should be relatively easy to add if
based on the order of the dependencies (or at least the order they're
presented to the mojo, which is hopefully the same)).
4. Probably a whole load of other features :)

Please give it a try and let me know how it goes.  I'd suggest looking
at the documentation for the eba-maven-plugin to get started.

Regards, Graham.

On 19 July 2012 12:57, Graham Charters <gc...@gmail.com> wrote:
> Sorry, I missed this thread the first time round.  David is right, the
> eba-maven-plugin is the best place to start.  It does also handle
> versions using the shared maven2osgiconverter (also used by the bundle
> plugin).
>
> I'll have a go at an esa-maven-plugin over the next few days.
>
> Regards, Graham.
>
> On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
>> Hi,
>>
>> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
>>
>>> Hi Felix,
>>>
>>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>>>>> 2. The Subsystem-Content lists all the dependencies of the project.
>>>>> However, because some of the bundles for this subsystem weren't
>>>>> developed with OSGi in mind, the start ordering is significant. I
>>>>> don't know of an easy way to generate this so currently it's hardcoded
>>>>> and hence duplicated. Also note that fragments obviously don't have a
>>>>> start-order.
>>>>
>>>> Just wondering: How could start order be forced in OSGi ?
>>>>
>>>> IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.
>>>
>>> The start-order is an attribute defined in the Subsystems spec section
>>> 134.12.1. It simply defines the order in which the bundles are started
>>> within that subsystem.
>>
>> I see, thanks.
>>
>> Regards
>> Felix

Re: How to generate SUBSYSTEM.MF with maven?

Posted by Graham Charters <gc...@gmail.com>.
Sorry, I missed this thread the first time round.  David is right, the
eba-maven-plugin is the best place to start.  It does also handle
versions using the shared maven2osgiconverter (also used by the bundle
plugin).

I'll have a go at an esa-maven-plugin over the next few days.

Regards, Graham.

On 2 July 2012 13:38, Felix Meschberger <fm...@gmail.com> wrote:
> Hi,
>
> Am 02.07.2012 um 12:22 schrieb David Bosschaert:
>
>> Hi Felix,
>>
>> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>>>> 2. The Subsystem-Content lists all the dependencies of the project.
>>>> However, because some of the bundles for this subsystem weren't
>>>> developed with OSGi in mind, the start ordering is significant. I
>>>> don't know of an easy way to generate this so currently it's hardcoded
>>>> and hence duplicated. Also note that fragments obviously don't have a
>>>> start-order.
>>>
>>> Just wondering: How could start order be forced in OSGi ?
>>>
>>> IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.
>>
>> The start-order is an attribute defined in the Subsystems spec section
>> 134.12.1. It simply defines the order in which the bundles are started
>> within that subsystem.
>
> I see, thanks.
>
> Regards
> Felix

Re: How to generate SUBSYSTEM.MF with maven?

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Am 02.07.2012 um 12:22 schrieb David Bosschaert:

> Hi Felix,
> 
> On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
>> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>>> 2. The Subsystem-Content lists all the dependencies of the project.
>>> However, because some of the bundles for this subsystem weren't
>>> developed with OSGi in mind, the start ordering is significant. I
>>> don't know of an easy way to generate this so currently it's hardcoded
>>> and hence duplicated. Also note that fragments obviously don't have a
>>> start-order.
>> 
>> Just wondering: How could start order be forced in OSGi ?
>> 
>> IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.
> 
> The start-order is an attribute defined in the Subsystems spec section
> 134.12.1. It simply defines the order in which the bundles are started
> within that subsystem.

I see, thanks.

Regards
Felix

Re: How to generate SUBSYSTEM.MF with maven?

Posted by David Bosschaert <da...@gmail.com>.
Hi Felix,

On 2 July 2012 11:13, Felix Meschberger <fm...@gmail.com> wrote:
> Am 01.07.2012 um 22:06 schrieb David Bosschaert:
>> 2. The Subsystem-Content lists all the dependencies of the project.
>> However, because some of the bundles for this subsystem weren't
>> developed with OSGi in mind, the start ordering is significant. I
>> don't know of an easy way to generate this so currently it's hardcoded
>> and hence duplicated. Also note that fragments obviously don't have a
>> start-order.
>
> Just wondering: How could start order be forced in OSGi ?
>
> IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.

The start-order is an attribute defined in the Subsystems spec section
134.12.1. It simply defines the order in which the bundles are started
within that subsystem. In my case I need this because my subsystem
uses some bundles that weren't originally written for OSGi and they do
some static initialization that has to be ordered in a certain way to
function correctly.

Cheers,

David

Re: How to generate SUBSYSTEM.MF with maven?

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Am 01.07.2012 um 22:06 schrieb David Bosschaert:

> Hi all,
> 
> I've playing with the current subsystems implementation and thanks to
> John Ross fixing some bugs I've been able to get a subsystem with the
> CXF-DOSGi functionality working :)
> 
> However, I've been thinking what the best way is to create a subsystem
> in maven... My current impl has a few issues and maybe others have
> some ideas how to improve:
> 1. My SUBSYSTEM.MF [1] needs to have the OSGi variant of the
> ${project.version} so it needs to translate 1.4.0-SNAPSHOT into
> 1.4.0.SNAPSHOT. Anyone know a way to do this?

IIRC the maven commons sub-part of the bundle plugin has a utility method to achieve this conversion.

> 2. The Subsystem-Content lists all the dependencies of the project.
> However, because some of the bundles for this subsystem weren't
> developed with OSGi in mind, the start ordering is significant. I
> don't know of an easy way to generate this so currently it's hardcoded
> and hence duplicated. Also note that fragments obviously don't have a
> start-order.

Just wondering: How could start order be forced in OSGi ?

IIRC there is no such thing as start ordering because such an order can never be guaranteed -- start levels only help to a certain degree.

Regards
Felix


> 3. In [2] I'm using the maven-assembly plugin to get all the
> dependencies zipped up. However I need to have the .esa extension
> whereas this plugin insists on .zip. I'm currently achieving that by
> copying the .zip file to an .esa and then attaching the .esa to the
> project but that's kinda wasteful as it puts both the .zip and the
> .esa in the maven repo (and they're a couple of megs each).
> 
> 2 above might be a bit hard to achieve in the short term, but 1 and 3
> might be possible given the right amount of maven-fu?
> I guess it would really be nice if there was a maven plugin that could
> do all this ;)
> 
> Cheers,
> 
> David
> 
> [1] http://svn.apache.org/repos/asf/cxf/dosgi/trunk/distribution/subsystem/src/main/resources/OSGI-INF/SUBSYSTEM.MF
> [2] http://svn.apache.org/repos/asf/cxf/dosgi/trunk/distribution/subsystem/pom.xml


Re: How to generate SUBSYSTEM.MF with maven?

Posted by David Bosschaert <da...@gmail.com>.
Sounds like a great idea, David.

WRT to start order, one option could be to add a flag to the plugin
configuration that would simply add the start order in the same order
the dependencies are listed in the pom (I assume you can read this out
in the order they are declared?). So you either have start order
specified in the SUBSYSTEM.MF or you don't. For Subsystems that
consist of well-behaved OSGi bundles, the start order is not needed,
so I think that should be the default.

> Let me know if you start looking at this so we don't duplicate effort.

I wasn't planning to - if you have time to look at this that would be awesome!

Cheers,

David

Re: How to generate SUBSYSTEM.MF with maven?

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Am 02.07.2012 um 01:57 schrieb David Jencks:

> I think a lot of these issues may be solved by the eba-maven-plugin.  I've been hoping to have a bit of time to copy and update it to deal with subsystems.
> 
> I don't know of any way to deal with start order in any reasonable way.  Maven is uncooperative about letting you add plugin specific bits of info to dependencies.  

We have the same issue with the Maven Launchpad Plugin in Sling (we add the bundle start levels). We falled back to have a special bundle list formatted along the lines of the regular maven dependencies and injecting the listed bundles into the regular maven dependency list at project configuration time.

Regards
Felix


> In the karaf-maven-plugin feature generation I made it so you can specify a single start order for a feature, but I don't think this works for subsystems since karaf features are just sets of bundles started in with the other bundles whereas IIUC in a subsystem the start order is for that subsystem.
> 
> On the other hand I think I saw some discussion recently on the maven list about perhaps allowing non-inheritable extra attrtibutes on dependencies.  Since for subsystems we almost certainly don't want to follow transitive dependencies (using obr instead) this might work (if I didn't make it up).
> 
> Let me know if you start looking at this so we don't duplicate effort.
> 
> thanks
> david jencks
> 
> On Jul 1, 2012, at 1:06 PM, David Bosschaert wrote:
> 
>> Hi all,
>> 
>> I've playing with the current subsystems implementation and thanks to
>> John Ross fixing some bugs I've been able to get a subsystem with the
>> CXF-DOSGi functionality working :)
>> 
>> However, I've been thinking what the best way is to create a subsystem
>> in maven... My current impl has a few issues and maybe others have
>> some ideas how to improve:
>> 1. My SUBSYSTEM.MF [1] needs to have the OSGi variant of the
>> ${project.version} so it needs to translate 1.4.0-SNAPSHOT into
>> 1.4.0.SNAPSHOT. Anyone know a way to do this?
>> 2. The Subsystem-Content lists all the dependencies of the project.
>> However, because some of the bundles for this subsystem weren't
>> developed with OSGi in mind, the start ordering is significant. I
>> don't know of an easy way to generate this so currently it's hardcoded
>> and hence duplicated. Also note that fragments obviously don't have a
>> start-order.
>> 3. In [2] I'm using the maven-assembly plugin to get all the
>> dependencies zipped up. However I need to have the .esa extension
>> whereas this plugin insists on .zip. I'm currently achieving that by
>> copying the .zip file to an .esa and then attaching the .esa to the
>> project but that's kinda wasteful as it puts both the .zip and the
>> .esa in the maven repo (and they're a couple of megs each).
>> 
>> 2 above might be a bit hard to achieve in the short term, but 1 and 3
>> might be possible given the right amount of maven-fu?
>> I guess it would really be nice if there was a maven plugin that could
>> do all this ;)
>> 
>> Cheers,
>> 
>> David
>> 
>> [1] http://svn.apache.org/repos/asf/cxf/dosgi/trunk/distribution/subsystem/src/main/resources/OSGI-INF/SUBSYSTEM.MF
>> [2] http://svn.apache.org/repos/asf/cxf/dosgi/trunk/distribution/subsystem/pom.xml
> 


Re: How to generate SUBSYSTEM.MF with maven?

Posted by David Jencks <da...@yahoo.com>.
I think a lot of these issues may be solved by the eba-maven-plugin.  I've been hoping to have a bit of time to copy and update it to deal with subsystems.

I don't know of any way to deal with start order in any reasonable way.  Maven is uncooperative about letting you add plugin specific bits of info to dependencies.  In the karaf-maven-plugin feature generation I made it so you can specify a single start order for a feature, but I don't think this works for subsystems since karaf features are just sets of bundles started in with the other bundles whereas IIUC in a subsystem the start order is for that subsystem.

On the other hand I think I saw some discussion recently on the maven list about perhaps allowing non-inheritable extra attrtibutes on dependencies.  Since for subsystems we almost certainly don't want to follow transitive dependencies (using obr instead) this might work (if I didn't make it up).

Let me know if you start looking at this so we don't duplicate effort.

thanks
david jencks

On Jul 1, 2012, at 1:06 PM, David Bosschaert wrote:

> Hi all,
> 
> I've playing with the current subsystems implementation and thanks to
> John Ross fixing some bugs I've been able to get a subsystem with the
> CXF-DOSGi functionality working :)
> 
> However, I've been thinking what the best way is to create a subsystem
> in maven... My current impl has a few issues and maybe others have
> some ideas how to improve:
> 1. My SUBSYSTEM.MF [1] needs to have the OSGi variant of the
> ${project.version} so it needs to translate 1.4.0-SNAPSHOT into
> 1.4.0.SNAPSHOT. Anyone know a way to do this?
> 2. The Subsystem-Content lists all the dependencies of the project.
> However, because some of the bundles for this subsystem weren't
> developed with OSGi in mind, the start ordering is significant. I
> don't know of an easy way to generate this so currently it's hardcoded
> and hence duplicated. Also note that fragments obviously don't have a
> start-order.
> 3. In [2] I'm using the maven-assembly plugin to get all the
> dependencies zipped up. However I need to have the .esa extension
> whereas this plugin insists on .zip. I'm currently achieving that by
> copying the .zip file to an .esa and then attaching the .esa to the
> project but that's kinda wasteful as it puts both the .zip and the
> .esa in the maven repo (and they're a couple of megs each).
> 
> 2 above might be a bit hard to achieve in the short term, but 1 and 3
> might be possible given the right amount of maven-fu?
> I guess it would really be nice if there was a maven plugin that could
> do all this ;)
> 
> Cheers,
> 
> David
> 
> [1] http://svn.apache.org/repos/asf/cxf/dosgi/trunk/distribution/subsystem/src/main/resources/OSGI-INF/SUBSYSTEM.MF
> [2] http://svn.apache.org/repos/asf/cxf/dosgi/trunk/distribution/subsystem/pom.xml