This ran without an error with Maven 1.0 rc1 -- I don't know if the Jelly tags have 
changed in going from beta 10 to rc1.

To test it I added an <echo> in the loop and changed the search for "mp-" to ".maven". 
 Finally, you probably want to use the replaceAll(regex,String) method.  The replace 
method takes only character arguments and you are trying to replace entire substrings.

Hope that helped.

Sri

-----Original Message-----
From: John Farrell [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 09, 2003 2:14 AM
To: Maven Users; [EMAIL PROTECTED]
Subject: how do I do this tricky string manipulation with jelly/maven?

It seems to me that Jelly script doesn't support multiple parameters in 
brackets in Java script fragments. The code below puts NumberFormatExceptions 
in maven.log. What I need to do is (a) find another way which involves only 
single parameter methods, or (b) get Jelly to play the game a bit more. Any 
ideas? I am using Maven beta 10. 

<ant:pathconvert property="origPath" pathsep=";" 
refid="maven.dependency.classpath" />
<j:forEach var="pathElement" items="${origPath.split(';')}">
    <j:if test="${pathElement.indexOf('mp-') >= 0}">
        <j:set var="cloverJar" value="${pathElement.replace('.jar', 
'clover.jar')}" />
    </j:if>
</j:forEach>

Thanks for any inspiration,

John

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to