You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Carsten Ziegeler <cz...@apache.org> on 2008/01/08 09:22:23 UTC

Defaults for the Sling Plugin

I'm wondering if it would make sense to change the default setting for 
the sling plugin regarding the installation of the bundle into a running 
sling application.

Currently the default is to install it, if the plugin is added to the 
build. The url of the running sling app is also preconfigured.

Now, this means that as soon as you add the plugin and build your 
project it gets installed in a running app which might or might not what 
you want :)

During development it's very handy to get the bundle installed, but of 
course for other things like assembling releases etc. you don't want it.

I would like to change the configuration to:
a) Leave the skip flag as is but remove the default value for the sling.url
b) Only install if the sling.url is set
c) if the sling.url is set, the skip flag can be used to prevent 
installing the bundle.


Does this make sense? I really would like to pre-configure the sling 
plugin but I don't want an automatic install. The other option I see is 
just to change the default value of the skip flag.

Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Defaults for the Sling Plugin

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

Am Dienstag, den 08.01.2008, 10:07 +0100 schrieb Carsten Ziegeler:
> Felix Meschberger wrote:
> > Hi,
> > 
> > Am Dienstag, den 08.01.2008, 09:51 +0100 schrieb Carsten Ziegeler:
> >> Felix Meschberger wrote:
> >>> Hi,
> >>>
> >>> I am at unease with both solutions ;-)
> >> :)
> >>
> >>> But I think clearing the URL and not doing anything if the url is
> >>> missing is probably the better solution. Otherwise we would have the
> >>> strange situation - when calling the install or deploy goal from the
> >>> command line - that we would say "call the goal AND don't skip it"...
> >>>
> >>> The question is, why you want to configure the Sling plugin into the
> >>> project: If it is for the assembly and/or war goals, we would probably
> >>> be better off to split these goals into one or two separate plugins.
> >>>
> >> I want to use the install feature into a local app during development. I 
> >> tried
> > 
> > Ah ! I always call the plugin from the command line like this:
> > 
> >   $ mvn clean package org.apache.sling:maven-sling-plugin:install
> > 
> > and thanks to bash I just can reuse the command line ...
> > 
> D'oh - sometimes the solution is too simple :)
> Ok, so forget about this thread and thanks!

You are welcome and thanks for updating the FAQ.

Regards
Felix



Re: Defaults for the Sling Plugin

Posted by Carsten Ziegeler <cz...@apache.org>.
Bertrand Delacretaz wrote:
> On Jan 8, 2008 10:49 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> 
>> ...As we will not configure this plugin for our sling bundles everything
>> works as expected....
> 
> Ok - I seemed to remember the plugin being active in some Sling modules.
> 
Really? No, no - that's not possible..........

:)

I removed the usage of the sling plugin from the bundles in r609918. But 
even if these declarations would have been left in, they wouldn't do 
anything as they were not configured to install the bundle.

Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Defaults for the Sling Plugin

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Jan 8, 2008 10:49 AM, Carsten Ziegeler <cz...@apache.org> wrote:

> ...As we will not configure this plugin for our sling bundles everything
> works as expected....

Ok - I seemed to remember the plugin being active in some Sling modules.

But if it's not, then I'm fine with the current defaults.

-Bertrand

Re: Defaults for the Sling Plugin

Posted by Carsten Ziegeler <cz...@apache.org>.
Bertrand Delacretaz wrote:
> On Jan 8, 2008 10:28 AM, Felix Meschberger <fm...@gmail.com> wrote:
> 
>> ...  * If the sling plugin IS configured in the project, the installation
>>       happens in the "install" phase - and of course fails if there is
>>       no local install....
> 
> Here's my failure scenario:
> 
> -Beginner runs some Sling example app, on the default port as Beginners do.
> 
> -Beginner plays around with other modules, tries to build them ("mvn
> install" - that's the default for Maven Beginners) while studying the
> example app.
> 
> -Modules which have the Sling plugin configured get their bundles
> installed. That's almost invisible - there are way too many messages
> in the build cycle for Beginner anyway.
> 
> -Confused Beginner is left with a "patched" Mystery Example App which
> behaves in weird ways due to the added bundles. And *we* have to
> explain Beginner what's going on...
> 
> Don't we all hate <insert large software company name here> for
> installing "upgrades" automatically behind people's backs?
Ah, you mean "Pineapple"?

> 
> I really think we should turn off these automatic installs, by default.
Yepp, agreed - but they are turned off by default as the plugin is not 
configured. If you configure the plugin, your intention is to install 
the bundle into your local app as this is the purpose of the plugin. Its 
like configuring the bundleplugin to create a bundle.
As we will not configure this plugin for our sling bundles everything 
works as expected. And the average user will not configure it either as 
she is not aware of the plugin.

Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Defaults for the Sling Plugin

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

Am Dienstag, den 08.01.2008, 10:40 +0100 schrieb Bertrand Delacretaz:
> On Jan 8, 2008 10:28 AM, Felix Meschberger <fm...@gmail.com> wrote:
> 
> > ...  * If the sling plugin IS configured in the project, the installation
> >       happens in the "install" phase - and of course fails if there is
> >       no local install....
> 
> Here's my failure scenario:
> 
> -Beginner runs some Sling example app, on the default port as Beginners do.

ACK

> 
> -Beginner plays around with other modules, tries to build them ("mvn
> install" - that's the default for Maven Beginners) while studying the
> example app.

ACK

> 
> -Modules which have the Sling plugin configured get their bundles
> installed. That's almost invisible - there are way too many messages
> in the build cycle for Beginner anyway.

ACK. BUT: There should be none in Sling, AFAIK.

> 
> -Confused Beginner is left with a "patched" Mystery Example App which
> behaves in weird ways due to the added bundles. And *we* have to
> explain Beginner what's going on...
> 
> Don't we all hate <insert large software company name here> for
> installing "upgrades" automatically behind people's backs?

Agreed, but I am not sure, whether this is the same case here ...

> 
> I really think we should turn off these automatic installs, by default.

Still, I am against changing the defaults.

What I could agree to, and this would make the uses very obvious, is to
separate the install and deploy goals into separate plugins. If then
someone configures the - say - maven-slinginstall-plugin, the users must
live with the result.

Regards
Felix


Re: Defaults for the Sling Plugin

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Jan 8, 2008 10:28 AM, Felix Meschberger <fm...@gmail.com> wrote:

> ...  * If the sling plugin IS configured in the project, the installation
>       happens in the "install" phase - and of course fails if there is
>       no local install....

Here's my failure scenario:

-Beginner runs some Sling example app, on the default port as Beginners do.

-Beginner plays around with other modules, tries to build them ("mvn
install" - that's the default for Maven Beginners) while studying the
example app.

-Modules which have the Sling plugin configured get their bundles
installed. That's almost invisible - there are way too many messages
in the build cycle for Beginner anyway.

-Confused Beginner is left with a "patched" Mystery Example App which
behaves in weird ways due to the added bundles. And *we* have to
explain Beginner what's going on...

Don't we all hate <insert large software company name here> for
installing "upgrades" automatically behind people's backs?

I really think we should turn off these automatic installs, by default.

-Bertrand

Re: Defaults for the Sling Plugin

Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger wrote:
> Hi,
> 
> Am Dienstag, den 08.01.2008, 10:25 +0100 schrieb Bertrand Delacretaz:
>> On Jan 8, 2008 10:07 AM, Carsten Ziegeler <cz...@apache.org> wrote:
>>
>>> ...D'oh - sometimes the solution is too simple :)...
>> Still, will you change the default to *not* install the bundles?
>>
>> Installing them automatically by default is bad bad bad IMHO,
>> according to the Principle Of Least Surprise ;-)
> 
> Agreed, but:
> 
>   * If the sling plugin is NOT configured in the project, nothing
> happens
>   * If the sling plugin IS configured in the project, the installation
>       happens in the "install" phase - and of course fails if there is
>       no local install.
> 
> So I think, we can live with the defaults right now.
> 
Yepp, same here.

Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Defaults for the Sling Plugin

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

Am Dienstag, den 08.01.2008, 10:25 +0100 schrieb Bertrand Delacretaz:
> On Jan 8, 2008 10:07 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> 
> > ...D'oh - sometimes the solution is too simple :)...
> 
> Still, will you change the default to *not* install the bundles?
> 
> Installing them automatically by default is bad bad bad IMHO,
> according to the Principle Of Least Surprise ;-)

Agreed, but:

  * If the sling plugin is NOT configured in the project, nothing
happens
  * If the sling plugin IS configured in the project, the installation
      happens in the "install" phase - and of course fails if there is
      no local install.

So I think, we can live with the defaults right now.

Regards
Felix


Re: Defaults for the Sling Plugin

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Jan 8, 2008 10:07 AM, Carsten Ziegeler <cz...@apache.org> wrote:

> ...D'oh - sometimes the solution is too simple :)...

Still, will you change the default to *not* install the bundles?

Installing them automatically by default is bad bad bad IMHO,
according to the Principle Of Least Surprise ;-)

-Bertrand

Re: Defaults for the Sling Plugin

Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger wrote:
> Hi,
> 
> Am Dienstag, den 08.01.2008, 09:51 +0100 schrieb Carsten Ziegeler:
>> Felix Meschberger wrote:
>>> Hi,
>>>
>>> I am at unease with both solutions ;-)
>> :)
>>
>>> But I think clearing the URL and not doing anything if the url is
>>> missing is probably the better solution. Otherwise we would have the
>>> strange situation - when calling the install or deploy goal from the
>>> command line - that we would say "call the goal AND don't skip it"...
>>>
>>> The question is, why you want to configure the Sling plugin into the
>>> project: If it is for the assembly and/or war goals, we would probably
>>> be better off to split these goals into one or two separate plugins.
>>>
>> I want to use the install feature into a local app during development. I 
>> tried
> 
> Ah ! I always call the plugin from the command line like this:
> 
>   $ mvn clean package org.apache.sling:maven-sling-plugin:install
> 
> and thanks to bash I just can reuse the command line ...
> 
D'oh - sometimes the solution is too simple :)
Ok, so forget about this thread and thanks!

Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Defaults for the Sling Plugin

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

Am Dienstag, den 08.01.2008, 09:51 +0100 schrieb Carsten Ziegeler:
> Felix Meschberger wrote:
> > Hi,
> > 
> > I am at unease with both solutions ;-)
> :)
> 
> > 
> > But I think clearing the URL and not doing anything if the url is
> > missing is probably the better solution. Otherwise we would have the
> > strange situation - when calling the install or deploy goal from the
> > command line - that we would say "call the goal AND don't skip it"...
> > 
> > The question is, why you want to configure the Sling plugin into the
> > project: If it is for the assembly and/or war goals, we would probably
> > be better off to split these goals into one or two separate plugins.
> > 
> I want to use the install feature into a local app during development. I 
> tried

Ah ! I always call the plugin from the command line like this:

  $ mvn clean package org.apache.sling:maven-sling-plugin:install

and thanks to bash I just can reuse the command line ...

Regards
Felix

> defining a "develop" profile in the parent pom, so I could do a
> "mvn -P develop install" at runtime for a sling bundle. But 
> unfortunately profiles are not inherited, so either I define the profile 
> in each bundle or I can convince everyone to change the default :)
> 
> Carsten
> 
> 


Re: Defaults for the Sling Plugin

Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger wrote:
> Hi,
> 
> I am at unease with both solutions ;-)
:)

> 
> But I think clearing the URL and not doing anything if the url is
> missing is probably the better solution. Otherwise we would have the
> strange situation - when calling the install or deploy goal from the
> command line - that we would say "call the goal AND don't skip it"...
> 
> The question is, why you want to configure the Sling plugin into the
> project: If it is for the assembly and/or war goals, we would probably
> be better off to split these goals into one or two separate plugins.
> 
I want to use the install feature into a local app during development. I 
tried
defining a "develop" profile in the parent pom, so I could do a
"mvn -P develop install" at runtime for a sling bundle. But 
unfortunately profiles are not inherited, so either I define the profile 
in each bundle or I can convince everyone to change the default :)

Carsten


-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Defaults for the Sling Plugin

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Jan 8, 2008 9:38 AM, Felix Meschberger <fm...@gmail.com> wrote:

> ...I think clearing the URL and not doing anything if the url is
> missing is probably the better solution....

Agreed, and it' be good for the plugin to output a message like
"bundle not installed as sling.url is empty", to let the developers
know about this auto install feature.

-Bertrand

Re: Defaults for the Sling Plugin

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

I am at unease with both solutions ;-)

But I think clearing the URL and not doing anything if the url is
missing is probably the better solution. Otherwise we would have the
strange situation - when calling the install or deploy goal from the
command line - that we would say "call the goal AND don't skip it"...

The question is, why you want to configure the Sling plugin into the
project: If it is for the assembly and/or war goals, we would probably
be better off to split these goals into one or two separate plugins.

WDYT ?

Regards
Felix

Am Dienstag, den 08.01.2008, 09:22 +0100 schrieb Carsten Ziegeler:
> I'm wondering if it would make sense to change the default setting for 
> the sling plugin regarding the installation of the bundle into a running 
> sling application.
> 
> Currently the default is to install it, if the plugin is added to the 
> build. The url of the running sling app is also preconfigured.
> 
> Now, this means that as soon as you add the plugin and build your 
> project it gets installed in a running app which might or might not what 
> you want :)
> 
> During development it's very handy to get the bundle installed, but of 
> course for other things like assembling releases etc. you don't want it.
> 
> I would like to change the configuration to:
> a) Leave the skip flag as is but remove the default value for the sling.url
> b) Only install if the sling.url is set
> c) if the sling.url is set, the skip flag can be used to prevent 
> installing the bundle.
> 
> 
> Does this make sense? I really would like to pre-configure the sling 
> plugin but I don't want an automatic install. The other option I see is 
> just to change the default value of the skip flag.
> 
> Carsten