You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Prasad Jeewantha <je...@gmail.com> on 2013/04/01 07:46:59 UTC

Help needed to use maven to build an osgi application

Hi all,
I am trying to build an osgi application with Maven. I am using
maven-bundle-plugin and maven-scr-plugin to create the bundles. I have all
the bundles created in 3 separate directories in the final distribution.
What I want is to run all the osgi bundles in an OSGi container with a
single command (may be using a shell script). I believe I have to create a
config.ini file listing all the bundles which need to be run in the
container. Is there a way to generate this file from Maven at compilation
time? Or is there a better way to create the project without manually
creating the configuration files? Any advice is greatly appreciated.
Thanks in advance,
PJ

PS. I created a Stack overflow question on this topic.
http://stackoverflow.com/q/15729182/1411653

Re: Help needed to use maven to build an osgi application

Posted by Ferry Huberts <ma...@hupie.com>.

On 02/04/13 06:31, Prasad Jeewantha wrote:
> Hi Chetan,
> Thanks a lot for the response. What I want is to package all the bundles in
> some structure in the final distribution so that when the user extracts it
> and run say *sh run.sh* all the bundles will be installed into an osgi
> runtime. The usage of OSGi should be hidden from the user. I believe option
> 3 will be helpful. Thanks again,

Then you can also just use the bnd export function, which is also
supported by bndtools.


> PJ
> 
> 
> On Mon, Apr 1, 2013 at 11:47 AM, Chetan Mehrotra
> <ch...@gmail.com>wrote:
> 
>> There are multiple options to achieve this.
>>
>> 1. Pax Runner - Use Pax Runner [1] if you want your bare bone OSGi
>> container. See [2] for some example. It allows you to package and launch an
>> OSGi container
>> 2. Use existing applications like Apache Karaf to package your bundle
>> 3. Use maven-launchpad-plugin [3] to package the bundle as part of single
>> executable jar. This is currenly limited to supporting Felix and would not
>> work for Equinox. See [4] as one example of this plugin in action which
>> packages a bunch of bundles as part of an example application
>>
>>
>> Chetan Mehrotra
>> [1] https://ops4j1.jira.com/wiki/display/paxrunner/Documentation
>> [2] http://www.jroller.com/habuma/entry/launching_osgi_with_pax_runner
>> [3] http://sling.apache.org/site/maven-launchpad-plugin.html
>> [4]
>> https://github.com/apache/felix/blob/trunk/examples/jaas/launcher/pom.xml
>>
>> On Mon, Apr 1, 2013 at 11:16 AM, Prasad Jeewantha <jeewamp.dev@gmail.com
>>> wrote:
>>
>>> Hi all,
>>> I am trying to build an osgi application with Maven. I am using
>>> maven-bundle-plugin and maven-scr-plugin to create the bundles. I have
>> all
>>> the bundles created in 3 separate directories in the final distribution.
>>> What I want is to run all the osgi bundles in an OSGi container with a
>>> single command (may be using a shell script). I believe I have to create
>> a
>>> config.ini file listing all the bundles which need to be run in the
>>> container. Is there a way to generate this file from Maven at compilation
>>> time? Or is there a better way to create the project without manually
>>> creating the configuration files? Any advice is greatly appreciated.
>>> Thanks in advance,
>>> PJ
>>>
>>> PS. I created a Stack overflow question on this topic.
>>> http://stackoverflow.com/q/15729182/1411653
>>>
>>
> 

-- 
Ferry Huberts

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Help needed to use maven to build an osgi application

Posted by Prasad Jeewantha <je...@gmail.com>.
Hi Chetan,
Thanks a lot for the response. What I want is to package all the bundles in
some structure in the final distribution so that when the user extracts it
and run say *sh run.sh* all the bundles will be installed into an osgi
runtime. The usage of OSGi should be hidden from the user. I believe option
3 will be helpful. Thanks again,
PJ


On Mon, Apr 1, 2013 at 11:47 AM, Chetan Mehrotra
<ch...@gmail.com>wrote:

> There are multiple options to achieve this.
>
> 1. Pax Runner - Use Pax Runner [1] if you want your bare bone OSGi
> container. See [2] for some example. It allows you to package and launch an
> OSGi container
> 2. Use existing applications like Apache Karaf to package your bundle
> 3. Use maven-launchpad-plugin [3] to package the bundle as part of single
> executable jar. This is currenly limited to supporting Felix and would not
> work for Equinox. See [4] as one example of this plugin in action which
> packages a bunch of bundles as part of an example application
>
>
> Chetan Mehrotra
> [1] https://ops4j1.jira.com/wiki/display/paxrunner/Documentation
> [2] http://www.jroller.com/habuma/entry/launching_osgi_with_pax_runner
> [3] http://sling.apache.org/site/maven-launchpad-plugin.html
> [4]
> https://github.com/apache/felix/blob/trunk/examples/jaas/launcher/pom.xml
>
> On Mon, Apr 1, 2013 at 11:16 AM, Prasad Jeewantha <jeewamp.dev@gmail.com
> >wrote:
>
> > Hi all,
> > I am trying to build an osgi application with Maven. I am using
> > maven-bundle-plugin and maven-scr-plugin to create the bundles. I have
> all
> > the bundles created in 3 separate directories in the final distribution.
> > What I want is to run all the osgi bundles in an OSGi container with a
> > single command (may be using a shell script). I believe I have to create
> a
> > config.ini file listing all the bundles which need to be run in the
> > container. Is there a way to generate this file from Maven at compilation
> > time? Or is there a better way to create the project without manually
> > creating the configuration files? Any advice is greatly appreciated.
> > Thanks in advance,
> > PJ
> >
> > PS. I created a Stack overflow question on this topic.
> > http://stackoverflow.com/q/15729182/1411653
> >
>

Re: Help needed to use maven to build an osgi application

Posted by Chetan Mehrotra <ch...@gmail.com>.
There are multiple options to achieve this.

1. Pax Runner - Use Pax Runner [1] if you want your bare bone OSGi
container. See [2] for some example. It allows you to package and launch an
OSGi container
2. Use existing applications like Apache Karaf to package your bundle
3. Use maven-launchpad-plugin [3] to package the bundle as part of single
executable jar. This is currenly limited to supporting Felix and would not
work for Equinox. See [4] as one example of this plugin in action which
packages a bunch of bundles as part of an example application


Chetan Mehrotra
[1] https://ops4j1.jira.com/wiki/display/paxrunner/Documentation
[2] http://www.jroller.com/habuma/entry/launching_osgi_with_pax_runner
[3] http://sling.apache.org/site/maven-launchpad-plugin.html
[4]
https://github.com/apache/felix/blob/trunk/examples/jaas/launcher/pom.xml

On Mon, Apr 1, 2013 at 11:16 AM, Prasad Jeewantha <je...@gmail.com>wrote:

> Hi all,
> I am trying to build an osgi application with Maven. I am using
> maven-bundle-plugin and maven-scr-plugin to create the bundles. I have all
> the bundles created in 3 separate directories in the final distribution.
> What I want is to run all the osgi bundles in an OSGi container with a
> single command (may be using a shell script). I believe I have to create a
> config.ini file listing all the bundles which need to be run in the
> container. Is there a way to generate this file from Maven at compilation
> time? Or is there a better way to create the project without manually
> creating the configuration files? Any advice is greatly appreciated.
> Thanks in advance,
> PJ
>
> PS. I created a Stack overflow question on this topic.
> http://stackoverflow.com/q/15729182/1411653
>