You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Peter Kahn <ci...@gmail.com> on 2006/04/21 18:51:16 UTC
> Jelly Replace & Maven 1.0.2 - Docs and Reality Don't Match up?
I am using maven102 to try some simple pattern manipulation on a property.
According to the doc for the jelly util:replace tag, I can replace strings
withing a string. According to how its working, I cannot do this. Could it
be that the docs refer to a release of jelly after my release of maven?
I have a property that looks like this
foo=one two three
and I'd like to snip the 'two' out of it. According to the jelly docs for
jelly:util:replace I should be able to use the set of attributess (oldChar,
newChar) for changing individual characters and the set (old, new) for
changing strings
Doc:
http://jakarta.apache.org/commons/jelly/libs/util/tags.html#util:replace
Therefore the following should be true
where u is jelly:util
<u:replace value="${maven.help.all}" var="x" trim="True" oldChar="two"
newChar=" "/>
<echo>${x}</echo>
The result should be 'one wo hree'
And for this
<u:replace value="${maven.help.all}" var="x" trim="True" old="two" new="
"/>
<echo>${x}</echo>
The result should be 'one three'
The problem is when I use the old and new attributes, I get the following
error
maven.xml:13:93: <u:replace> This tag does not understand the 'old'
attribute
--
Peter Kahn
citizenkahn@gmail.com
citizenkahn@jabber80.com, skype: citizenkahn
Re: > Jelly Replace & Maven 1.0.2 - Docs and Reality Don't Match up?
Posted by Peter Kahn <ci...@gmail.com>.
Great. Thanks. I should have gone to the community several hours ago. I
snuck around it with some ant regexp manipulation (not as clean, but it
works).
On 4/21/06, Lukas Theussl <lt...@apache.org> wrote:
>
> Your suspicion is correct: Maven 1.0.2 shipped with jelly-util 1.0 which
> did not support string substitution (character substitution should
> work). Maven 1.1 beta has upgraded to jelly-util 1.1.1, there it will
> work. In our plugins we use the commons.lang.StringUtils class as a
> workaround, this will work with both m1.0 and m1.1.
>
> HTH,
> -Lukas
>
>
--
Peter Kahn
citizenkahn@gmail.com
Re: > Jelly Replace & Maven 1.0.2 - Docs and Reality Don't Match
up?
Posted by Lukas Theussl <lt...@apache.org>.
Your suspicion is correct: Maven 1.0.2 shipped with jelly-util 1.0 which
did not support string substitution (character substitution should
work). Maven 1.1 beta has upgraded to jelly-util 1.1.1, there it will
work. In our plugins we use the commons.lang.StringUtils class as a
workaround, this will work with both m1.0 and m1.1.
HTH,
-Lukas
Peter Kahn wrote:
> I am using maven102 to try some simple pattern manipulation on a property.
> According to the doc for the jelly util:replace tag, I can replace strings
> withing a string. According to how its working, I cannot do this. Could it
> be that the docs refer to a release of jelly after my release of maven?
>
> I have a property that looks like this
> foo=one two three
>
> and I'd like to snip the 'two' out of it. According to the jelly docs for
> jelly:util:replace I should be able to use the set of attributess (oldChar,
> newChar) for changing individual characters and the set (old, new) for
> changing strings
> Doc:
> http://jakarta.apache.org/commons/jelly/libs/util/tags.html#util:replace
>
>
> Therefore the following should be true
> where u is jelly:util
> <u:replace value="${maven.help.all}" var="x" trim="True" oldChar="two"
> newChar=" "/>
> <echo>${x}</echo>
>
> The result should be 'one wo hree'
>
> And for this
> <u:replace value="${maven.help.all}" var="x" trim="True" old="two" new="
> "/>
> <echo>${x}</echo>
>
> The result should be 'one three'
>
>
> The problem is when I use the old and new attributes, I get the following
> error
> maven.xml:13:93: <u:replace> This tag does not understand the 'old'
> attribute
>
> --
> Peter Kahn
> citizenkahn@gmail.com
> citizenkahn@jabber80.com, skype: citizenkahn
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org