Hello again
I don,t think that you will be able to use the variable directly in the
property file thought. Only jelly scripts can have variables replaced by
their runtime value. Like the Ant properties, they get assigned only in
Ant scripts executed by Ant. Jelly variable are a little like the Ant
properties, except that the jelly vars. can have their value change over
time. Unlike properties (in Ant), these can have a value set but its
immutable after setting it.
Jelly can be a little, well, complicated, especially if you embedded
Java code in expression. I've not figured out yet exactly all the rules
in jelly expressions, the jelly expression parser is a nasty beast...
But you can get around pretty easily.
Maybe I've misguided you. If you need the value of that variable inside
a property file, you have to actually write this value in the property
file using Ant/Jelly code. Otherwise, if you put the variable name in
there (in the property file), the variable name will be the value of the
property.
NP! Hope it does help you do what you need.
Eric.
Marco Mistroni wrote:
hello eric,
thanx for the tip.. beside, i have to learn jelly, but is it reasonablet
to use a jelly variable my property s hould be in both java code
and a config file?
thanx and regards
marco
On 8/9/05, Eric Giguère <[EMAIL PROTECTED]> wrote:
Hello Marco
For such a need, use the jelly variable.
What you would do typically is initiate your variable using the property
value, then you can modify its value. That would do the trick in runtime
but if you need to actually write this value in a property, check the
Ant <property> tag, that should allow you to write the value in your
property file.
Hope it helps
Eric.
Marco Mistroni wrote:
hello all,
i am building an application using Maven.
I have defined some custom properties in project.properties, and i
can successfully retrieve them inside my java code using
System.getPRoperteis.
I was wondering however if maven can substitute properties defined
inside project.properties also in normal configuration files.
example:
i have a config file called openejb.config in which i have to define
a datasource wiht url, username and password
i need same informations also for my dbunit tests, so i have defined
those 3passwords inside my project properteis.
in my java code i use System.getPRoperty("username") to get value
from properties, but in my config file i have tried to do
${username}
hoping that during compiation/build maven would have substituted it
with the value of the property username defined in project.properties
But it didn't work...
Is it possible to do that? if so, how?
thanks in advance and regards
marco
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]