maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Anderson <benander...@benanderson.us>
Subject Re: dynamic property access
Date Fri, 29 Oct 2004 17:59:43 GMT
yes, that's a solution for the example I gave, but not what I'm looking for. 
Let me give the real example:

config.properties
-----------------
servername.qa=qaServer
servername.prod=prodServer

maven.xml
---------
<u:properties var="props" file="config.properties"/>
<j:forEach var="prop" items="${props}">
  <ant:copy file="${basedir}/WEB-INF/web.xml"
            tofile="${build.dir}/WEB-INF/web.xml"
            overwrite="true">
    <ant:filterset>
      <ant:filter token="servername" value="${servername.${env}}"/>


actually, this is probably a bit much.  Is there a way to solve the original
example w/out modifying the <j:set> tags?

Thanks,
Ben

Quoting Eric Giguere <eric.giguere@videotron.ca>:

> Hello Ben
> Yep, try this:
>
>     <j:set var="color" value="red"/>
>     <j:set var="colorKey" value="${color}"/>
>     <ant:echo>
>         ${colorKey}
>     </ant:echo>
>
>
> Hope it helps
> Eric.
>
> Ben Anderson wrote:
>
> >Hi,
> >I want to dynamically set which property I access.  Is this possible?
> >Obviously the below code won't work, but you get the idea.  I thought
> >maybe that the <j:expr> tag might help, but it doesn't seem to do
> >anything.
> >
> >    <j:set var="color" value="red"/>
> >    <j:set var="colorKey" value="color"/>
> >    <ant:echo>
> >        ${${colorKey}}
> >    </ant:echo>
> >
> >Any ideas?
> >
> >Thanks,
> >Ben
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>




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


Mime
View raw message