You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Richard S. Hall" <he...@ungoverned.org> on 2006/05/24 12:11:24 UTC

Maven OSGi plugin update

For those who may not have paid attention to the the JIRA message 
describing the Maven OSGi plugin update, I will repeat it here.

Peter Kriens' submitted a patch to the plugin to automatically generate 
Import-Package and Bundle-Activator headers and to verify Export-Package 
headers. I committed this patch.

I converted all of my subprojects POM files to remove both 
Import-Package and Bundle-Activator entries and everything is working 
fine. Sweet!

Please test this on your own POM files. It is somewhat simplistic when 
determining the bundle activator, so if you import your activator or 
have subclasses, etc. then it might not detect it correctly, thus you 
should add it manually.

Nonetheless, it should greatly simplify bundle development.

-> richard

Re: Maven OSGi plugin update

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Timothy Bennett wrote:
> Is the documentation on the usage of the Maven OSGi plugin up-to-date at
> http://docs.safehaus.org/display/OSGI/OSGi+Plugin+for+Maven+2.0?

I added a few words about the auto-generation of some of the headers and 
updated the list of supported headers.

-> richard

Re: Maven OSGi plugin update

Posted by Timothy Bennett <ti...@exterminator-x.com>.
On 5/24/06, Richard S. Hall <he...@ungoverned.org> wrote:
>
> For those who may not have paid attention to the the JIRA message
> describing the Maven OSGi plugin update, I will repeat it here.
>
> Peter Kriens' submitted a patch to the plugin to automatically generate
> Import-Package and Bundle-Activator headers and to verify Export-Package
> headers. I committed this patch.
>
> I converted all of my subprojects POM files to remove both
> Import-Package and Bundle-Activator entries and everything is working
> fine. Sweet!
>
> Please test this on your own POM files. It is somewhat simplistic when
> determining the bundle activator, so if you import your activator or
> have subclasses, etc. then it might not detect it correctly, thus you
> should add it manually.
>
> Nonetheless, it should greatly simplify bundle development.
>
> -> richard
>

Richard,

Is the documentation on the usage of the Maven OSGi plugin up-to-date at
http://docs.safehaus.org/display/OSGI/OSGi+Plugin+for+Maven+2.0?

-- 
timothy

Re: Maven OSGi plugin update

Posted by "Richard S. Hall" <he...@ungoverned.org>.
LECAN Damien wrote:
> Do you think this plugin will be hosted by Maven itself later ? Or by codehaus ?
> It would be great if 'osgi-bundle' packaging could be 'official' (as war, ear, ...)
>
> Will you make make soon a release of the plugin, or do you wait for a whole Felix release ?

All good questions, but I don't really know the answers. I would imagine 
that we will host the plugin somewhere, but I have no idea about it 
being hosted by Maven.

-> richard

Re: Maven OSGi plugin update

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Thursday 25 May 2006 17:25, Richard S. Hall wrote:
> As a follow up...
>
> The plugin auto-generates the Import-Package header entry if the entry
> is not specified in the POM file. If the entry is specified in the POM
> file, then the plugin will verify its contents.
>
> I just made a modification to the plugin to generate WARNINGs when it
> detects a discrepancy, rather than ERRORs as it was previously doing.
>
> The issue here is that the plugin generates an exhaustive list of
> everything that needs to be imported by the bundle, including everything
> that is referenced by any embedded JAR files. It might be the case that
> you don't need to import everything that is referenced internally if you
> never use functionality from that part of the code.

Yes, it imports quite aggressively. I have added;

 o an <excludeImport> tag, which is a comma-separated list of packages NOT to
   import.

 o Added print out of the references in Maven debug mode (-X)

 o Added a system property "osgi.whoUses", so that one can do;
      mvn -DwhoUses=junit.framework install
   and get a list of packages that refers to it.

 o Trims the whitespaces in many config tags.

Patches for the two files are sitting in 
http://issues.apache.org/jira/browse/FELIX-73

Hope the patch makes it to the codebase this time. 


Cheers
Niclas

Re: Maven OSGi plugin update

Posted by "Richard S. Hall" <he...@ungoverned.org>.
As a follow up...

The plugin auto-generates the Import-Package header entry if the entry 
is not specified in the POM file. If the entry is specified in the POM 
file, then the plugin will verify its contents.

I just made a modification to the plugin to generate WARNINGs when it 
detects a discrepancy, rather than ERRORs as it was previously doing.

The issue here is that the plugin generates an exhaustive list of 
everything that needs to be imported by the bundle, including everything 
that is referenced by any embedded JAR files. It might be the case that 
you don't need to import everything that is referenced internally if you 
never use functionality from that part of the code.

-> richard

Enrique Rodriguez wrote:
> LECAN Damien wrote:
>> Hello
>>
>>> I committed this patch.
>
> Great to finally see Peter's contribution in there.
>
>> Great news :) It works perfectly until now.
>> I will fill in new enhancement suggestions.
>>
>> Do you think this plugin will be hosted by Maven itself later ? Or by 
>> codehaus ?
>> It would be great if 'osgi-bundle' packaging could be 'official' (as 
>> war, ear, ...)
>
> I agree, osgi-bundle would be an excellent 'official' packaging type 
> and I believe it would make the configuration slightly easier.  With 
> Peter's contribution and mangen, combined with pulling some of the 
> bundle manifest headers from elsewhere in the POM, we might be able to 
> drastically reduce configuration.
>
> Enrique
>

Re: Maven OSGi plugin update

Posted by Enrique Rodriguez <en...@gmail.com>.
LECAN Damien wrote:
> Hello
> 
>> I committed this patch.

Great to finally see Peter's contribution in there.

> Great news :) It works perfectly until now.
> I will fill in new enhancement suggestions.
> 
> Do you think this plugin will be hosted by Maven itself later ? Or by codehaus ?
> It would be great if 'osgi-bundle' packaging could be 'official' (as war, ear, ...)

I agree, osgi-bundle would be an excellent 'official' packaging type and 
I believe it would make the configuration slightly easier.  With Peter's 
contribution and mangen, combined with pulling some of the bundle 
manifest headers from elsewhere in the POM, we might be able to 
drastically reduce configuration.

Enrique

RE: Maven OSGi plugin update

Posted by LECAN Damien <Da...@B2i.fr>.
Hello

> I committed this patch.
Great news :) It works perfectly until now.
I will fill in new enhancement suggestions.

Do you think this plugin will be hosted by Maven itself later ? Or by codehaus ?
It would be great if 'osgi-bundle' packaging could be 'official' (as war, ear, ...)

Will you make make soon a release of the plugin, or do you wait for a whole Felix release ?

Thanks


Damien Lecan

--
Telematic Systems
B2i - Viveris Group France