You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tom Joad <tj...@gmail.com> on 2008/03/26 11:34:22 UTC
How to retrieve property from files
Hello all,
My problem is quite simple.
I have a properties file wherein i have projectname webmodulename,
version and other informations.
I'd like to tell maven to retrieve these values into the pom.xml .For
instance , i need to set default target directory to
${projectname}-${version} instead of target.
With ant it is only property file. And how about maven?
I already try to set properties tag on the same level as url but it is
not recognized.So pom.xml can't be parsed. However ,I find it in xsd
file of pom.
Thanks for your helps.
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How to retrieve property from files
Posted by Tom Joad <tj...@gmail.com>.
Ok . I need to consider our build processing in other way ie maven way.
Thanks again.
2008/3/26, Wayne Fay <wa...@gmail.com>:
> Maven is not Ant. Maven does not read from external property files and
> insert values into the pom at runtime.
>
>
> Wayne
>
> On 3/26/08, Tom Joad <tj...@gmail.com> wrote:
> > Thanks , I'll already do it.
> > So the example of target i give is not the good one.I need to load
> > some properties that i don't know the value by advance. Our
> > development center tag a version of application in cvs , and send us
> > a file where are defined the version, the projectname, the moduleweb
> > name, etc...
> > This file is property type file and I want to use variable name under
> > pom.xml with value
> > loaded from this property file.
> > So is it possible?
> >
> > 2008/3/26, Wayne Fay <wa...@gmail.com>:
> > > Maven does not support reading properties out of external files like Ant.
> > >
> > > As for changing from /target to /whatever, before you start heading
> > > down this road, please do a little reading about what Maven is trying
> > > to do for you etc. Sonatype.com and Devzuz.com have links to free pdf
> > > ebooks they have produced.
> > >
> > > Wayne
> > >
> > >
> > > On 3/26/08, Tom Joad <tj...@gmail.com> wrote:
> > > > Hello all,
> > > > My problem is quite simple.
> > > > I have a properties file wherein i have projectname webmodulename,
> > > > version and other informations.
> > > > I'd like to tell maven to retrieve these values into the pom.xml .For
> > > > instance , i need to set default target directory to
> > > > ${projectname}-${version} instead of target.
> > > > With ant it is only property file. And how about maven?
> > > > I already try to set properties tag on the same level as url but it is
> > > > not recognized.So pom.xml can't be parsed. However ,I find it in xsd
> > > > file of pom.
> > > >
> > > > Thanks for your helps.
> > > >
> > > > Tom
> > > >
> > >
> > > > ---------------------------------------------------------------------
> > > > 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
> >
> >
>
> ---------------------------------------------------------------------
> 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: How to retrieve property from files
Posted by Wayne Fay <wa...@gmail.com>.
Maven is not Ant. Maven does not read from external property files and
insert values into the pom at runtime.
Wayne
On 3/26/08, Tom Joad <tj...@gmail.com> wrote:
> Thanks , I'll already do it.
> So the example of target i give is not the good one.I need to load
> some properties that i don't know the value by advance. Our
> development center tag a version of application in cvs , and send us
> a file where are defined the version, the projectname, the moduleweb
> name, etc...
> This file is property type file and I want to use variable name under
> pom.xml with value
> loaded from this property file.
> So is it possible?
>
> 2008/3/26, Wayne Fay <wa...@gmail.com>:
> > Maven does not support reading properties out of external files like Ant.
> >
> > As for changing from /target to /whatever, before you start heading
> > down this road, please do a little reading about what Maven is trying
> > to do for you etc. Sonatype.com and Devzuz.com have links to free pdf
> > ebooks they have produced.
> >
> > Wayne
> >
> >
> > On 3/26/08, Tom Joad <tj...@gmail.com> wrote:
> > > Hello all,
> > > My problem is quite simple.
> > > I have a properties file wherein i have projectname webmodulename,
> > > version and other informations.
> > > I'd like to tell maven to retrieve these values into the pom.xml .For
> > > instance , i need to set default target directory to
> > > ${projectname}-${version} instead of target.
> > > With ant it is only property file. And how about maven?
> > > I already try to set properties tag on the same level as url but it is
> > > not recognized.So pom.xml can't be parsed. However ,I find it in xsd
> > > file of pom.
> > >
> > > Thanks for your helps.
> > >
> > > Tom
> > >
> >
> > > ---------------------------------------------------------------------
> > > 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How to retrieve property from files
Posted by Tom Joad <tj...@gmail.com>.
Thanks , I'll already do it.
So the example of target i give is not the good one.I need to load
some properties that i don't know the value by advance. Our
development center tag a version of application in cvs , and send us
a file where are defined the version, the projectname, the moduleweb
name, etc...
This file is property type file and I want to use variable name under
pom.xml with value
loaded from this property file.
So is it possible?
2008/3/26, Wayne Fay <wa...@gmail.com>:
> Maven does not support reading properties out of external files like Ant.
>
> As for changing from /target to /whatever, before you start heading
> down this road, please do a little reading about what Maven is trying
> to do for you etc. Sonatype.com and Devzuz.com have links to free pdf
> ebooks they have produced.
>
> Wayne
>
>
> On 3/26/08, Tom Joad <tj...@gmail.com> wrote:
> > Hello all,
> > My problem is quite simple.
> > I have a properties file wherein i have projectname webmodulename,
> > version and other informations.
> > I'd like to tell maven to retrieve these values into the pom.xml .For
> > instance , i need to set default target directory to
> > ${projectname}-${version} instead of target.
> > With ant it is only property file. And how about maven?
> > I already try to set properties tag on the same level as url but it is
> > not recognized.So pom.xml can't be parsed. However ,I find it in xsd
> > file of pom.
> >
> > Thanks for your helps.
> >
> > Tom
> >
>
> > ---------------------------------------------------------------------
> > 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
Re: How to retrieve property from files
Posted by Wayne Fay <wa...@gmail.com>.
Maven does not support reading properties out of external files like Ant.
As for changing from /target to /whatever, before you start heading
down this road, please do a little reading about what Maven is trying
to do for you etc. Sonatype.com and Devzuz.com have links to free pdf
ebooks they have produced.
Wayne
On 3/26/08, Tom Joad <tj...@gmail.com> wrote:
> Hello all,
> My problem is quite simple.
> I have a properties file wherein i have projectname webmodulename,
> version and other informations.
> I'd like to tell maven to retrieve these values into the pom.xml .For
> instance , i need to set default target directory to
> ${projectname}-${version} instead of target.
> With ant it is only property file. And how about maven?
> I already try to set properties tag on the same level as url but it is
> not recognized.So pom.xml can't be parsed. However ,I find it in xsd
> file of pom.
>
> Thanks for your helps.
>
> Tom
>
> ---------------------------------------------------------------------
> 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