You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bert Lamb <be...@gmail.com> on 2005/02/07 20:49:07 UTC
possible resolve a property
Is it possible to have a property with a "variable" (eg.
my.directory.to.something=${basedir}/my/directory/ ), but have it
resolve the "variable" at that time? Any idea how I can do this? I
would like to have a directory defined that multiproject
projects can pickup, but in this case then ${basedir} will be wrong.
-Bert
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: possible resolve a property
Posted by Brett Porter <br...@gmail.com>.
No, Bert's problem is that he is inheriting project.properties and the
property inherits the expression, not the value of the expression.
This almost always relates to basedir.
Presently, the best way to do this is to <j:set /> in the maven.xml to
set some other variable that you can use for that project, eg:
<j:set var="mydir" value="${basedir}" />
my.property=${mydir}/...
However, it is worth taking a look at why script in a subproject needs
to access files from a parent project anyway - this is possibly a bad
practice.
Cheers,
Brett
On Mon, 7 Feb 2005 15:20:27 -0500, Rick Mangi <rm...@yahoo.com> wrote:
> Yes, just like you suggest. That will work fine... or is the question
> how to set the variable?
>
> You can set it in build.properties or project.properties
>
> You can also set it in maven.xml:
>
> <j:set var="subProjects" value="some-sub-project"/>
>
>
> On Feb 7, 2005, at 2:49 PM, Bert Lamb wrote:
>
> > Is it possible to have a property with a "variable" (eg.
> > my.directory.to.something=${basedir}/my/directory/ ), but have it
> > resolve the "variable" at that time? Any idea how I can do this? I
> > would like to have a directory defined that multiproject
> > projects can pickup, but in this case then ${basedir} will be wrong.
> >
> > -Bert
> >
> > ---------------------------------------------------------------------
> > 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
Re: possible resolve a property
Posted by Rick Mangi <rm...@yahoo.com>.
Yes, just like you suggest. That will work fine... or is the question
how to set the variable?
You can set it in build.properties or project.properties
You can also set it in maven.xml:
<j:set var="subProjects" value="some-sub-project"/>
On Feb 7, 2005, at 2:49 PM, Bert Lamb wrote:
> Is it possible to have a property with a "variable" (eg.
> my.directory.to.something=${basedir}/my/directory/ ), but have it
> resolve the "variable" at that time? Any idea how I can do this? I
> would like to have a directory defined that multiproject
> projects can pickup, but in this case then ${basedir} will be wrong.
>
> -Bert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>