Thanks for you help.

Ransford Segu-Baffoe

[email protected]

http://www.noqmx.com/
https://serenade.dev.java.net/

--- On Wed, 10/21/09, Ian Boston <[email protected]> wrote:


From: Ian Boston <[email protected]>
Subject: Re: Sling based project
To: [email protected]
Date: Wednesday, October 21, 2009, 5:08 AM



On 21 Oct 2009, at 06:26, paksegu wrote:

> Hi,
> Supposingly i want to create a project or app (eg Sakai), wich maven pom 
> (artifact) will I have to include in my project? I am thinking the Apache 
> Sling Launchpad Bundles pom will be a good starting point, WDYT?

If you want to create an OSGi bundle that works in Sling, then you don't really 
need to use any parent pom for your project. You will need to create a valid 
OSGi MANIFEST.MF and you may need to create the correct OSGi service 
definitions. Probably the easiest way to do this is to use the Felix SCR Maven 
plugin with Annotations and the Felix Bundle Maven plugin to auto generate the 
MANIFEST.MF and serviceComponents.xml file.

To get a default configuration of these plugins you could just use the Sling 
parent as the parent of your project pom eg
  <parent>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling</artifactId>
        <version>6</version>
        <relativePath>../../../parent/pom.xml</relativePath>
    </parent>

Or, if you really are developing a bundle for Sakai (which extends Sling) then 
the Sakai parent.
eg
  <parent>
    <groupId>org.sakaiproject.kernel</groupId>
    <artifactId>base</artifactId>
    <version>0.1-SNAPSHOT</version>
  </parent>

Thats all you should need to create the bundle
----------------------------------

To deploy the bundle you need to have a Running OSGi container with all the 
dependencies that you need to make your bundle work. Sling comes with 2 main 
runtime bundles. A war that starts inside any web container and contains the 
whole of the OSGi framework, or a standalone application that is an OSGi 
framework. (standalone, and webapp). You can load you newly created jar into 
that bundle by a number of means.

If you start one of these packagings of Sling as it stands, the web console 
(http://localhost:8080/system/console/bundles) you can load you jar by 
uploading it through the web interface.

If you want to automate the loading there is a maven plugin to load as part of 
the build and the Sakai parent contains a profile that allows mvn -Predeploy 
clean install to redeploy a bundle as part of the build.

There are also other mechanism to load your bundle like the FileInstaller.

------------------------------------

If you want to build your bundle into a single standalone jar, you might want 
to extend the launchpad to add your own jars in at build time. This is what 
Sakai has done taking the standalone bundle and customizing it to add an 
additional 45-50 bundles.

HTH
Ian


> 
> 
> Ransford Segu-Baffoe
> 
> [email protected]
> 
> http://www.noqmx.com/
> https://serenade.dev.java.net/
> 
> 




      

Reply via email to