I tried this and it doesn't work.  If I pass in an archetypeId with a dash in
it, it gets replaced verbatime with the archetypeId (no replacement takes
place).

Matt


Raphaël Piéroni-3 wrote:
> 
> Hi Matt,
> 
> According to String javadoc, you could try the replace(char oldChar, char
> newChar) method
> 
> <jdbc.url><![CDATA[jdbc:mysql://localhost/${artifactId.replace('-','_')}
> ?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=utf-8]]></jdbc.url>
> 
> I don't know if it works.
> 
> Regards,
> 
> 
> Raphaël
> 
> 
> 2007/2/3, mraible <[EMAIL PROTECTED]>:
>>
>> I'd have the following in the pom.xml of an archetype:
>>
>> <jdbc.url
>><![CDATA[jdbc:mysql://localhost/${artifactId}?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=utf-8]]></jdbc.url>
>>
>> If users use a dash in their artifactId, this will fail on most
>> databases.
>> Is there a String replacement tool available in the VelocityContext of
>> the
>> archetype-plugin?  I'd like to do something like:
>>
>> $stringutil.replace(${artifactId}, '-', '_')
>>
>> Thanks,
>>
>> Matt
>> --
>> View this message in context:
> http://www.nabble.com/Is-it-possible-to-do-string-replacement-in-an-archetype--tf3167058s177.html#a8785517
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-do-string-replacement-in-an-archetype--tf3167058s177.html#a8785763
Sent from the Maven - Users mailing list archive at Nabble.com.


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

Reply via email to