You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Qian Su <qs...@cj.com> on 2005/02/09 21:31:52 UTC

Question on accessing user-defined properties in maven.xml

Hi,

 

I declared a property of my own in project.properties file, but failed
to access the value of this property in maven.xml.  Below is my sample
code in project.properties and maven.xml:

 

(project.properties)

hibernate.doclet.generate=true

 

(maven.xml)

<j:if test="${systemScope['hibernate.doclet.generate'] == 'true'}">

            ...

</j:if>

 

It seems that the property set in project.properties is not visible in
maven.xml, however, if I run maven with
-Dhibernate.doclet.generate=true, then the 'if' statement does evaluate
to true.  I tried to look for online resources to see how to access
user-defined properties in maven.xml but failed.  I would really
appreciate any help here since it is a very commonly desired feature.

 

Qian

 


Re: Question on accessing user-defined properties in maven.xml

Posted by Lukasz Bajorski <lb...@gmail.com>.
On Wed, 9 Feb 2005 12:31:52 -0800, Qian Su <qs...@cj.com> wrote:
> Hi,
> 
> I declared a property of my own in project.properties file, but failed
> to access the value of this property in maven.xml.  Below is my sample
> code in project.properties and maven.xml:
> 
> (project.properties)
> 
> hibernate.doclet.generate=true
> 
> (maven.xml)
> 
> <j:if test="${systemScope['hibernate.doclet.generate'] == 'true'}">

try using ${context.getVariable('hibernate.doclet.generate') == 'true'} instead

---
Lukasz Bajorski


> 
>             ...
> 
> </j:if>
> 
> It seems that the property set in project.properties is not visible in
> maven.xml, however, if I run maven with
> -Dhibernate.doclet.generate=true, then the 'if' statement does evaluate
> to true.  I tried to look for online resources to see how to access
> user-defined properties in maven.xml but failed.  I would really
> appreciate any help here since it is a very commonly desired feature.
> 
> 
> Qian
> 
>

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