You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by rturnbull <ry...@utilitran.com> on 2006/02/22 17:15:44 UTC
Declaration of an array in project.properties file
Hello to all,
I'm trying to make a variable in the project.properties file that an
array. This array will then be looped through with a forEach from the
jelly:core library. Is it possible to declare or even use arrays in the
project.properties file?? Please let me know as I have the code
written, all I need is this array and everyone at work here will be very
happy.
Thanks
--
Ryan Turnbull
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Declaration of an array in project.properties file
Posted by rturnbull <ry...@utilitran.com>.
Thanks Doug!
So from my code snippet would this be correct??
project.properties file....
testing.array.list=1,2,3,4,5
maven.xml
<goal name="testingscript">
<jutil:tokenize var="${testing.array.list}" delim=","/>
<jcore:forEach var="currentDeployHost"
items="${testing.array.list}">
<jcore:set var="deploy.host"
value="${currentDeployHost}" />
<echo>${deploy.host}</echo>
</jcore:forEach>
</goal>
Thanks
Doug Douglass wrote:
> Ryan,
>
> Sounds like you're using maven 1...lists/arrays are not directly
> supported.
>
> Instead, specify the property value as a delimited string (e.g.,
> foo.property=1,2,3,4,5) and use the jelly util:tokenize[1] tag to
> split the property into a variable based on a delimiter (e.g., comma).
> Then you can use core:forEach on the newly create variable.
>
> [1]
> http://jakarta.apache.org/commons/jelly/libs/util/tags.html#util:tokenize
>
> HTH,
> Doug
>
> rturnbull wrote:
>> Hello to all,
>> I'm trying to make a variable in the project.properties file that
>> an array. This array will then be looped through with a forEach from
>> the jelly:core library. Is it possible to declare or even use arrays
>> in the project.properties file?? Please let me know as I have the
>> code written, all I need is this array and everyone at work here will
>> be very happy.
>>
>> Thanks
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
--
Ryan Turnbull
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Declaration of an array in project.properties file
Posted by Doug Douglass <dd...@denverdata.com>.
GREAT!!!
FYI: I see in the doco for forEach that the items attribute accepts a
comma-separated String. I've never tried it, but it could save you a
line of jelly.
Cheers,
Doug
rturnbull wrote:
> Thanks Doug,
> I was able to figure it out.... EXCELLENT!
>
> Ryan
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Declaration of an array in project.properties file
Posted by rturnbull <ry...@utilitran.com>.
Thanks Doug,
I was able to figure it out.... EXCELLENT!
Ryan
Doug Douglass wrote:
> Ryan,
>
> Sounds like you're using maven 1...lists/arrays are not directly
> supported.
>
> Instead, specify the property value as a delimited string (e.g.,
> foo.property=1,2,3,4,5) and use the jelly util:tokenize[1] tag to
> split the property into a variable based on a delimiter (e.g., comma).
> Then you can use core:forEach on the newly create variable.
>
> [1]
> http://jakarta.apache.org/commons/jelly/libs/util/tags.html#util:tokenize
>
> HTH,
> Doug
>
> rturnbull wrote:
>> Hello to all,
>> I'm trying to make a variable in the project.properties file that
>> an array. This array will then be looped through with a forEach from
>> the jelly:core library. Is it possible to declare or even use arrays
>> in the project.properties file?? Please let me know as I have the
>> code written, all I need is this array and everyone at work here will
>> be very happy.
>>
>> Thanks
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
--
Ryan Turnbull
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Declaration of an array in project.properties file
Posted by Doug Douglass <dd...@denverdata.com>.
Ryan,
Sounds like you're using maven 1...lists/arrays are not directly supported.
Instead, specify the property value as a delimited string (e.g.,
foo.property=1,2,3,4,5) and use the jelly util:tokenize[1] tag to split
the property into a variable based on a delimiter (e.g., comma). Then
you can use core:forEach on the newly create variable.
[1]
http://jakarta.apache.org/commons/jelly/libs/util/tags.html#util:tokenize
HTH,
Doug
rturnbull wrote:
> Hello to all,
> I'm trying to make a variable in the project.properties file that an
> array. This array will then be looped through with a forEach from the
> jelly:core library. Is it possible to declare or even use arrays in the
> project.properties file?? Please let me know as I have the code
> written, all I need is this array and everyone at work here will be very
> happy.
>
> Thanks
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org