You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Hervé BOUTEMY <he...@free.fr> on 2012/11/18 01:24:48 UTC

Preserve whitespace in Maven plugin configuration?

I just implemented MODELLO-256, which will permit to preserve whitespace in 
Maven plugins configuration: see MNG-5380 [1].

The question is: should we change the overall behaviour (plugins can trim when 
they need, and usually, there is no extra space in plugin configurations so 
nothing will break) or should we implement a more complex scenario where 
whitespace is trimmed by default but preserved only when xml:space="preserve" 
is found?

WDYT?

Hervé

[1] https://jira.codehaus.org/browse/MNG-5380

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


Re: Preserve whitespace in Maven plugin configuration?

Posted by Mark Struberg <st...@yahoo.de>.
As disucssed with Hervé on IRC: we also need to add ITs for all plugins which do POM rewriting, e.g.:

* maven-release-manager + maven-release-plugin

* versions-maven-plugin
* maven-shade-plugin

Probably more, that was only a quick list.

LieGrue,
strub


----- Original Message -----
> From: Hervé BOUTEMY <he...@free.fr>
> To: Maven Developers List <de...@maven.apache.org>
> Cc: 
> Sent: Sunday, November 18, 2012 11:14 AM
> Subject: Re: Preserve whitespace in Maven plugin configuration?
> 
> fair enough: I'll have to do the work :/
> at least I'm now convinced it is useful :)
> 
> I should be able to write it in Modello's generated code, so even if a field 
> is 
> of type DOM and (by default) configured as trim=true, if a XML content add the 
> xml:space="preserve" attribute, the reader won't trim
> 
> this discussion helped me find the good way to code, too
> 
> thanks
> 
> Hervé
> 
> Le dimanche 18 novembre 2012 10:06:33 Mark Struberg a écrit :
>>  That's a tricky one.
>> 
>>  1st: this is probably already optimized away by the XML reader.
>> 
>>  2nd:what about this configuration
>>    <url>
>>      someurl_handed_over_to_scm
>> 
>>    </url>
>> 
>>  In this case we really must get rid of the whitespaces, otherwise we would
>>  probably create lots of issues with plugins.
>> 
>>  LieGrue,
>>  strub
>> 
>> 
>>  ----- Original Message -----
>> 
>>  > From: Olivier Lamy <ol...@apache.org>
>>  > To: Maven Developers List <de...@maven.apache.org>
>>  > Cc:
>>  > Sent: Sunday, November 18, 2012 9:10 AM
>>  > Subject: Re: Preserve whitespace in Maven plugin configuration?
>>  > 
>>  > 2012/11/18 Hervé BOUTEMY <he...@free.fr>:
>>  >>  I just implemented MODELLO-256, which will permit to preserve 
> whitespace
>>  >>  in
>>  >>  Maven plugins configuration: see MNG-5380 [1].
>>  >>  
>>  >>  The question is: should we change the overall behaviour (plugins 
> can
>>  >>  trim
>>  > 
>>  > when
>>  > 
>>  >>  they need, and usually, there is no extra space in plugin 
> configurations
>>  >>  so
>>  >>  nothing will break) or should we implement a more complex 
> scenario where
>>  >>  whitespace is trimmed by default but preserved only when
>>  > 
>>  > xml:space="preserve"
>>  > 
>>  >>  is found?
>>  >>  
>>  >>  WDYT?
>>  > 
>>  > +1 for xml:space="preserve".
>>  > Using real norm sounds good for me.
>>  > 
>>  >>  Hervé
>>  >>  
>>  >>  [1] https://jira.codehaus.org/browse/MNG-5380
>>  >>  
>>  >>  
> ---------------------------------------------------------------------
>>  >>  To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>  >>  For additional commands, e-mail: dev-help@maven.apache.org
>>  > 
>>  > --
>>  > Olivier Lamy
>>  > Talend: http://coders.talend.com
>>  > http://twitter.com/olamy | http://linkedin.com/in/olamy
>>  > 
>>  > ---------------------------------------------------------------------
>>  > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>  > For additional commands, e-mail: dev-help@maven.apache.org
>> 
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>  For additional commands, e-mail: dev-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

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


Re: Preserve whitespace in Maven plugin configuration?

Posted by Hervé BOUTEMY <he...@free.fr>.
fair enough: I'll have to do the work :/
at least I'm now convinced it is useful :)

I should be able to write it in Modello's generated code, so even if a field is 
of type DOM and (by default) configured as trim=true, if a XML content add the 
xml:space="preserve" attribute, the reader won't trim

this discussion helped me find the good way to code, too

thanks

Hervé

Le dimanche 18 novembre 2012 10:06:33 Mark Struberg a écrit :
> That's a tricky one.
> 
> 1st: this is probably already optimized away by the XML reader.
> 
> 2nd:what about this configuration
>   <url>
>     someurl_handed_over_to_scm
> 
>   </url>
> 
> In this case we really must get rid of the whitespaces, otherwise we would
> probably create lots of issues with plugins.
> 
> LieGrue,
> strub
> 
> 
> ----- Original Message -----
> 
> > From: Olivier Lamy <ol...@apache.org>
> > To: Maven Developers List <de...@maven.apache.org>
> > Cc:
> > Sent: Sunday, November 18, 2012 9:10 AM
> > Subject: Re: Preserve whitespace in Maven plugin configuration?
> > 
> > 2012/11/18 Hervé BOUTEMY <he...@free.fr>:
> >>  I just implemented MODELLO-256, which will permit to preserve whitespace
> >>  in
> >>  Maven plugins configuration: see MNG-5380 [1].
> >>  
> >>  The question is: should we change the overall behaviour (plugins can
> >>  trim
> > 
> > when
> > 
> >>  they need, and usually, there is no extra space in plugin configurations
> >>  so
> >>  nothing will break) or should we implement a more complex scenario where
> >>  whitespace is trimmed by default but preserved only when
> > 
> > xml:space="preserve"
> > 
> >>  is found?
> >>  
> >>  WDYT?
> > 
> > +1 for xml:space="preserve".
> > Using real norm sounds good for me.
> > 
> >>  Hervé
> >>  
> >>  [1] https://jira.codehaus.org/browse/MNG-5380
> >>  
> >>  ---------------------------------------------------------------------
> >>  To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>  For additional commands, e-mail: dev-help@maven.apache.org
> > 
> > --
> > Olivier Lamy
> > Talend: http://coders.talend.com
> > http://twitter.com/olamy | http://linkedin.com/in/olamy
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

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


Re: Preserve whitespace in Maven plugin configuration?

Posted by Mark Struberg <st...@yahoo.de>.
That's a tricky one. 

1st: this is probably already optimized away by the XML reader.

2nd:what about this configuration
  <url>
    someurl_handed_over_to_scm

  </url>

In this case we really must get rid of the whitespaces, otherwise we would probably create lots of issues with plugins.

LieGrue,
strub


----- Original Message -----
> From: Olivier Lamy <ol...@apache.org>
> To: Maven Developers List <de...@maven.apache.org>
> Cc: 
> Sent: Sunday, November 18, 2012 9:10 AM
> Subject: Re: Preserve whitespace in Maven plugin configuration?
> 
> 2012/11/18 Hervé BOUTEMY <he...@free.fr>:
>>  I just implemented MODELLO-256, which will permit to preserve whitespace in
>>  Maven plugins configuration: see MNG-5380 [1].
>> 
>>  The question is: should we change the overall behaviour (plugins can trim 
> when
>>  they need, and usually, there is no extra space in plugin configurations so
>>  nothing will break) or should we implement a more complex scenario where
>>  whitespace is trimmed by default but preserved only when 
> xml:space="preserve"
>>  is found?
>> 
>>  WDYT?
> +1 for xml:space="preserve".
> Using real norm sounds good for me.
>> 
>>  Hervé
>> 
>>  [1] https://jira.codehaus.org/browse/MNG-5380
>> 
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>  For additional commands, e-mail: dev-help@maven.apache.org
>> 
> 
> 
> 
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

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


Re: Preserve whitespace in Maven plugin configuration?

Posted by Hervé BOUTEMY <he...@free.fr>.
Le dimanche 18 novembre 2012 09:10:33 Olivier Lamy a écrit :
> 2012/11/18 Hervé BOUTEMY <he...@free.fr>:
> > I just implemented MODELLO-256, which will permit to preserve whitespace
> > in
> > Maven plugins configuration: see MNG-5380 [1].
> > 
> > The question is: should we change the overall behaviour (plugins can trim
> > when they need, and usually, there is no extra space in plugin
> > configurations so nothing will break) or should we implement a more
> > complex scenario where whitespace is trimmed by default but preserved
> > only when xml:space="preserve" is found?
> > 
> > WDYT?
> 
> +1 for xml:space="preserve".
> Using real norm sounds good for me.
so, you like the complex scenario :(
(which is, yes, exciting since we're at least using a standard attribute)

the basic scenario where whitespace is preserved in plugin configuration 
(instead of trimmed previously) isn't sufficient?

Notice: the good answer for me as a coder is "yes, Keep It Stupid Simple", 
which seems sufficient from my experience, but if somebody knows of a real world 
case where space preserving would wreck havoc, I can make more code and add 
this xml:space="preserve" option

> 
> > Hervé
> > 
> > [1] https://jira.codehaus.org/browse/MNG-5380
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> 
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

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


Re: Preserve whitespace in Maven plugin configuration?

Posted by Olivier Lamy <ol...@apache.org>.
2012/11/18 Hervé BOUTEMY <he...@free.fr>:
> I just implemented MODELLO-256, which will permit to preserve whitespace in
> Maven plugins configuration: see MNG-5380 [1].
>
> The question is: should we change the overall behaviour (plugins can trim when
> they need, and usually, there is no extra space in plugin configurations so
> nothing will break) or should we implement a more complex scenario where
> whitespace is trimmed by default but preserved only when xml:space="preserve"
> is found?
>
> WDYT?
+1 for xml:space="preserve".
Using real norm sounds good for me.
>
> Hervé
>
> [1] https://jira.codehaus.org/browse/MNG-5380
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>



--
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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