Maven based projects

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Maven based projects

Dominik Süß
Hi everyone,

although repositorybased development with Sling/JCR may be pretty usefull
for the first steps I am now trying to set up a maven/eclipse/svn based
development environment.
And here's my problem:
I can't find a complete documentation about how to deploy sling apps in jcr
"embedded" in bundles. As far as I did understand the conversations and code
snippets here it is possible to bundle the scripts in an osgibundle and
unpack it in jcr within the installation of the bundle. Sadly my first test
failed since my poms didn't produce valid osgi bundles or didn't put any
script in JCR.

Could anyone who has done this give me some hints which maven plugins to use
and how to set up my poms?

Best regards,
Dominik
Reply | Threaded
Open this post in threaded view
|

Re: Maven based projects

gertv
Dominik,

We have an example on how to do this in the Apache ServiceMix code
sandbox
(http://svn.eu.apache.org/viewvc/servicemix/sandbox/gertv/smx-sling/servicemix-sling-console/).  
This pom.xml will create a bundle that can be deployed on Sling.  We
just added the Felix bundle plugin and configured it to load some
initial content and scripts from the src/main/resources/initial-content/
directory.

Regards,

Gert

Dominik Süß wrote:

> Hi everyone,
>
> although repositorybased development with Sling/JCR may be pretty usefull
> for the first steps I am now trying to set up a maven/eclipse/svn based
> development environment.
> And here's my problem:
> I can't find a complete documentation about how to deploy sling apps in jcr
> "embedded" in bundles. As far as I did understand the conversations and code
> snippets here it is possible to bundle the scripts in an osgibundle and
> unpack it in jcr within the installation of the bundle. Sadly my first test
> failed since my poms didn't produce valid osgi bundles or didn't put any
> script in JCR.
>
> Could anyone who has done this give me some hints which maven plugins to use
> and how to set up my poms?
>
> Best regards,
> Dominik
>
>  


Reply | Threaded
Open this post in threaded view
|

Re: Maven based projects

Bertrand Delacretaz
In reply to this post by Dominik Süß
Hi Dominik,

On Fri, Dec 19, 2008 at 9:45 AM, Dominik Süß <[hidden email]> wrote:
> ...As far as I did understand the conversations and code
> snippets here it is possible to bundle the scripts in an osgibundle and
> unpack it in jcr within the installation of the bundle....

Yes, that's what we call "initial content loading".

> ...Could anyone who has done this give me some hints which maven plugins to use
> and how to set up my poms?...

The webloader example at [1] might be a good starting point, I have
explicitely split in in two bundles, one for java code and one for
scripting.

The app is not terribly interesting, but you should be able to use it
as a starting point to build yours. One thing that you might need to
change is that the poms there depend on the sling parent pom, you
probably don't want that in your own apps.

-Bertrand

[1] https://svn.eu.apache.org/repos/asf/incubator/sling/trunk/samples/webloader
Reply | Threaded
Open this post in threaded view
|

Re: Maven based projects

Dominik Süß
Thanks to both of you :)
Sometimes its just that simple....

Best regards,
Dominik

On Fri, Dec 19, 2008 at 10:56 AM, Bertrand Delacretaz <
[hidden email]> wrote:

> Hi Dominik,
>
> On Fri, Dec 19, 2008 at 9:45 AM, Dominik Süß <[hidden email]>
> wrote:
> > ...As far as I did understand the conversations and code
> > snippets here it is possible to bundle the scripts in an osgibundle and
> > unpack it in jcr within the installation of the bundle....
>
> Yes, that's what we call "initial content loading".
>
> > ...Could anyone who has done this give me some hints which maven plugins
> to use
> > and how to set up my poms?...
>
> The webloader example at [1] might be a good starting point, I have
> explicitely split in in two bundles, one for java code and one for
> scripting.
>
> The app is not terribly interesting, but you should be able to use it
> as a starting point to build yours. One thing that you might need to
> change is that the poms there depend on the sling parent pom, you
> probably don't want that in your own apps.
>
> -Bertrand
>
> [1]
> https://svn.eu.apache.org/repos/asf/incubator/sling/trunk/samples/webloader
>
Reply | Threaded
Open this post in threaded view
|

Re: Maven based projects

Dominik Süß
Ok several new questions did pop up regarding this topic.
If I didn't miss a point there is no more relation between content (or...
scripts) and bundle, so uninstalling the bundle won't have any effect on the
installed scripts. Is there any way to have content (...scripts ;)) that is
just mapped in jcr and uninstalled togehter with the bundle?

The other question I have is:
Is json the only way to define metadata for the content?

Best regards,
Dominik

On Fri, Dec 19, 2008 at 2:31 PM, Dominik Süß <[hidden email]>wrote:

> Thanks to both of you :)
> Sometimes its just that simple....
>
> Best regards,
> Dominik
>
>
> On Fri, Dec 19, 2008 at 10:56 AM, Bertrand Delacretaz <
> [hidden email]> wrote:
>
>> Hi Dominik,
>>
>> On Fri, Dec 19, 2008 at 9:45 AM, Dominik Süß <[hidden email]>
>> wrote:
>> > ...As far as I did understand the conversations and code
>> > snippets here it is possible to bundle the scripts in an osgibundle and
>> > unpack it in jcr within the installation of the bundle....
>>
>> Yes, that's what we call "initial content loading".
>>
>> > ...Could anyone who has done this give me some hints which maven plugins
>> to use
>> > and how to set up my poms?...
>>
>> The webloader example at [1] might be a good starting point, I have
>> explicitely split in in two bundles, one for java code and one for
>> scripting.
>>
>> The app is not terribly interesting, but you should be able to use it
>> as a starting point to build yours. One thing that you might need to
>> change is that the poms there depend on the sling parent pom, you
>> probably don't want that in your own apps.
>>
>> -Bertrand
>>
>> [1]
>> https://svn.eu.apache.org/repos/asf/incubator/sling/trunk/samples/webloader
>>
>
>