You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Owen <mi...@hotmail.com> on 2005/07/28 18:56:35 UTC
[M1] Loading version from file
Hi,
I want to set the <currentVersion> in project.xml in Maven 1.0.2 to load
from a file. So far I have:
<currentVersion>${currentversion}</currentVersion>
If I then set currentversion to a value in a property file, it is set for
pom.currentVersion. What I need is to be able to set the property by loading
up the value from a file. I thought I could do this by doing this piece of
jelly script before every goal:
<loadfile property="currentversion" srcFile="${versionfile}"
failonerror="false"/>
However, this doesn't work because I guess the project.xml file has already
be loaded up etc. I therefore need to execute this as one of the first
things Maven does, before loading up project.xml, properties etc. Anybody
know how to do this, or any other ideas how loading from a file for the
<currentVersion> property can be achieved?
Many thanks,
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [M1] Loading version from file
Posted by Michael Owen <mi...@hotmail.com>.
I'm using Anthill Pro and it produces a version.txt file with the version in
which it created for the project. I want to use this version number for the
<currentVersion> in project.xml.
Seems a useful thing to be able to do, so I guess something must of done it
before. :)
Any help would be great?
Mike
<br><br><br>>From: Brett Porter
<brett.porter@gmail.com><br>>Reply-To: Brett Porter
<brett.porter@gmail.com><br>>To: Maven Users List
<users@maven.apache.org><br>>Subject: Re: [M1] Loading version from
file<br>>Date: Fri, 29 Jul 2005 02:59:22 +1000<br>><br>>It's only
possible from project.properties.<br>><br>>But I have to ask...
why?<br>><br>>- Brett<br>><br>>On 7/29/05, Michael Owen
<michaelowenuk@hotmail.com> wrote:<br>> > Hi,<br>>
><br>> > I want to set the <currentVersion> in project.xml in
Maven 1.0.2 to load<br>> > from a file. So far I have:<br>>
><br>> >
<currentVersion>${currentversion}</currentVersion><br>>
><br>> > If I then set currentversion to a value in a property
file, it is set for<br>> > pom.currentVersion. What I need is to be
able to set the property by loading<br>> > up the value from a file. I
thought I could do this by doing this piece of<br>> > jelly script
before every goal:<br>> ><br>> > <loadfile
property="currentversion"
srcFile="${versionfile}"<br>> >
failonerror="false"/><br>> ><br>> > However, this
doesn't work because I guess the project.xml file has already<br>> >
be loaded up etc. I therefore need to execute this as one of the
first<br>> > things Maven does, before loading up project.xml,
properties etc. Anybody<br>> > know how to do this, or any other ideas
how loading from a file for the<br>> > <currentVersion> property
can be achieved?<br>> ><br>> > Many thanks,<br>> ><br>>
> Mike<br>> ><br>> ><br>> ><br>> >
---------------------------------------------------------------------<br>>
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org<br>> >
For additional commands, e-mail: users-help@maven.apache.org<br>>
><br>>
><br>><br>>---------------------------------------------------------------------<br>>To
unsubscribe, e-mail: users-unsubscribe@maven.apache.org<br>>For
additional commands, e-mail: users-help@maven.apache.org<br>><br>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [M1] Loading version from file
Posted by Brett Porter <br...@gmail.com>.
It's only possible from project.properties.
But I have to ask... why?
- Brett
On 7/29/05, Michael Owen <mi...@hotmail.com> wrote:
> Hi,
>
> I want to set the <currentVersion> in project.xml in Maven 1.0.2 to load
> from a file. So far I have:
>
> <currentVersion>${currentversion}</currentVersion>
>
> If I then set currentversion to a value in a property file, it is set for
> pom.currentVersion. What I need is to be able to set the property by loading
> up the value from a file. I thought I could do this by doing this piece of
> jelly script before every goal:
>
> <loadfile property="currentversion" srcFile="${versionfile}"
> failonerror="false"/>
>
> However, this doesn't work because I guess the project.xml file has already
> be loaded up etc. I therefore need to execute this as one of the first
> things Maven does, before loading up project.xml, properties etc. Anybody
> know how to do this, or any other ideas how loading from a file for the
> <currentVersion> property can be achieved?
>
> Many thanks,
>
> Mike
>
>
>
> ---------------------------------------------------------------------
> 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