You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andreas Guther <ag...@paymentone.com> on 2004/11/03 03:28:28 UTC

Reading properties and re-using them as part of another key to read from a property file

 
Hi:
 
A colleague of mine has some problems with reading properties from a
property file and re-using them as part of another key.
  
The problem is basically that we first read a value from a property file
and then want to re-use this value as part of another key to read
another value from that property file.
 
This is his question, maybe someone can help.
 
Hi all,
 
My question involves a little explanation, so I hope it makes sense... 
I have a properties file that defines a property, which in turn form the
basis of extended property names:
name.switch=name-a
name-a.prop-1=true
name-b.prop-1=false
name-c.prop-1=false
Depending on what name.switch is, I need to read different properties
(name-1.prop-1 in this case).  So the kind of thing I need when
accessing the property is something like:
 
<j:set var="temp.db.username" value="${${name.switch}.prop-1"}/>
 
I found out that in ant, I could do it by using the ant-contrib library.
However, how do I do it in maven?
 
Thanks in advance for your help.
 
 
Andreas 
 
--------------------------------------------------------
 
This electronic mail message contains information belonging to PaymentOne, which may be confidential and/or legal privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, printing, copying, distribution, or the taking of any action in reliance on the contents of this electronically mailed information is strictly prohibited. If you receive this message in error, please immediately notify us by electronic mail and delete this message. 
--------------------------------------------------------
 
 
  

Re: Reading properties and re-using them as part of another key to read from a property file

Posted by Brett Porter <br...@gmail.com>.
search the archives, this was answered in the last week.

http://marc.theaimsgroup.com/?l=turbine-maven-user

eg
http://marc.theaimsgroup.com/?l=turbine-maven-user&w=2&r=1&s=property+as+key&q=b

giving:
http://marc.theaimsgroup.com/?t=109906955900001&r=1&w=2

- Brett

On Tue, 2 Nov 2004 18:28:28 -0800, Andreas Guther
<ag...@paymentone.com> wrote:
> 
> Hi:
> 
> A colleague of mine has some problems with reading properties from a
> property file and re-using them as part of another key.
> 
> The problem is basically that we first read a value from a property file
> and then want to re-use this value as part of another key to read
> another value from that property file.
> 
> This is his question, maybe someone can help.
> 
> Hi all,
> 
> My question involves a little explanation, so I hope it makes sense...
> I have a properties file that defines a property, which in turn form the
> basis of extended property names:
> name.switch=name-a
> name-a.prop-1=true
> name-b.prop-1=false
> name-c.prop-1=false
> Depending on what name.switch is, I need to read different properties
> (name-1.prop-1 in this case).  So the kind of thing I need when
> accessing the property is something like:
> 
> <j:set var="temp.db.username" value="${${name.switch}.prop-1"}/>
> 
> I found out that in ant, I could do it by using the ant-contrib library.
> However, how do I do it in maven?
> 
> Thanks in advance for your help.
> 
> Andreas
> 
> --------------------------------------------------------
> 
> This electronic mail message contains information belonging to PaymentOne, which may be confidential and/or legal privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, printing, copying, distribution, or the taking of any action in reliance on the contents of this electronically mailed information is strictly prohibited. If you receive this message in error, please immediately notify us by electronic mail and delete this message.
> --------------------------------------------------------
> 
>

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