You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2014/02/17 12:21:14 UTC

RFC: http://jira.codehaus.org/browse/MASSEMBLY-681

Hi,

I have taken a deeper look into the above issue...

In short:
<configuration>
   <finalName/>
</configuration>

If finalName is defined in configuration the name should be left 
empty...But here the problem is that the injection mechanism says ok 
the finalName is empty so we use the default value...


 From my point of view it looks like lacking some functionality 
....which can be solved by using some code ...I have create an example 
project where i can handle that....Or it might be possible to add an 
option like noFinalName....to handle the situation....

But the question is: Do you think that's going into the right direction 
to support such functionality (which might occure in several plugins) or 
would be better to go a different way...


Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: RFC: http://jira.codehaus.org/browse/MASSEMBLY-681

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Baptiste,


 > Hi,
> IIUC, you're talking about the injection difference that may be introduced
> between an absent and empty tag.
Yes you hit the nail on the head...

>
> If so, then by the way, the current situation is even worse than that :
> putting "*<someTag />"* or "*<someTag>  </someTag>"* results by default in
> the same thing: considered unspecified, and so null (or default-value) is
> injected.
> (Unless you use the special  xml:space="preserve" attribute, only for
> m3.1+, see [1] for example).
I would like to keep it more simple but you are absolutely right with 
your additions...

I tried to reduce it to simple two cases Just if the tag is there or 
not...(i know i'm missing some cases). Yours is the more general approach...

>
> I think that it's something that should be considered at least for m4.
> (or before, but not sure it's feasible to do it in a reasonably compatible
> way [in modello I guess?]. Maybe with additional compatibility switches for
> @Parameter, like defautValueBehaviour or something like that).
That looks like a solution for the future but currently i have to deal 
with things like in the issue ...

>
> Currently, IMO the least surprise principle isn't respected.

Yes that's exactly my opinion too ....

> As a user, for the build-helper:regex-property goal, for example. I can
> specify a regex and a replacement.
>
> When I say
>
>     - "" [empty string/absent tag]"
>     - "<replacement></replacement>"
>     - "<replacement> </replacement>"
>
>
> I mean different things. And currently Maven will merge all those 3 cases
> in one, as if the tag was left unspecified. For Maven usage, I would argue
> only the first case should trigger the defaultValue injection.
>
> So, to sum up, I agree with you. I think it's currently missing. Plugin
> developers could still be explicitly allowed to ask Maven injection to
> merge some of the cases above, but not as a default behaviour (or maybe
> only before m4 with a warning).

Can this be currently influenced by a plugin ? I wasn't aware of that is 
that possible at the moment ?


Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: RFC: http://jira.codehaus.org/browse/MASSEMBLY-681

Posted by Baptiste Mathus <bm...@batmat.net>.
Hi,
IIUC, you're talking about the injection difference that may be introduced
between an absent and empty tag.

If so, then by the way, the current situation is even worse than that :
putting "*<someTag />"* or "*<someTag>  </someTag>"* results by default in
the same thing: considered unspecified, and so null (or default-value) is
injected.
(Unless you use the special  xml:space="preserve" attribute, only for
m3.1+, see [1] for example).

I think that it's something that should be considered at least for m4.
(or before, but not sure it's feasible to do it in a reasonably compatible
way [in modello I guess?]. Maybe with additional compatibility switches for
@Parameter, like defautValueBehaviour or something like that).

Currently, IMO the least surprise principle isn't respected.
As a user, for the build-helper:regex-property goal, for example. I can
specify a regex and a replacement.

When I say

   - "" [empty string/absent tag]"
   - "<replacement></replacement>"
   - "<replacement> </replacement>"


I mean different things. And currently Maven will merge all those 3 cases
in one, as if the tag was left unspecified. For Maven usage, I would argue
only the first case should trigger the defaultValue injection.

So, to sum up, I agree with you. I think it's currently missing. Plugin
developers could still be explicitly allowed to ask Maven injection to
merge some of the cases above, but not as a default behaviour (or maybe
only before m4 with a warning).

[1]
https://svn.codehaus.org/mojo/trunk/mojo/build-helper-maven-plugin/src/it/mbuildhelper-34/pom.xml
coming
from MNG-5380


2014-02-17 12:21 GMT+01:00 Karl Heinz Marbaise <kh...@gmx.de>:

> Hi,
>
> I have taken a deeper look into the above issue...
>
> In short:
> <configuration>
>   <finalName/>
> </configuration>
>
> If finalName is defined in configuration the name should be left
> empty...But here the problem is that the injection mechanism says ok the
> finalName is empty so we use the default value...
>
>
> From my point of view it looks like lacking some functionality ....which
> can be solved by using some code ...I have create an example project where
> i can handle that....Or it might be possible to add an option like
> noFinalName....to handle the situation....
>
> But the question is: Do you think that's going into the right direction to
> support such functionality (which might occure in several plugins) or would
> be better to go a different way...
>
>
> Kind regards
> Karl Heinz Marbaise
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !