You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ch...@aami.com.au on 2008/05/20 08:39:13 UTC

sourcing from property files

Hi All.

        I know that this is backwards to the maven way of thinking, but:

        Is it possible to actually take a version number from a property 
file and have that used in the POM rather than the other way around?

        Ie,

                Property File -> POM

        rather than,

                POM -> Property File.

        Speaking of which how/can we get the version number in the pom 
written to a property file that is then used at runtime?

        Working this way just works better with our existing processes.

        TIA.

-Chris


**********************************************************************
CAUTION - This message is intended for the addressee named above. It may contain privileged or confidential information. 

If you are not the intended recipient of this message you must: 
- Not use, copy, distribute or disclose it to anyone other than the addressee;
- Notify the sender via return email; and
- Delete the message (and any related attachments) from your computer immediately.

Internet emails are not necessarily secure. Australian Associated Motors Insurers Limited ABN 92 004 791 744 (AAMI), and its related entities, do not accept responsibility for changes made to this message after it was sent.

Unless otherwise stated, views expressed within this email are the author's own and do not represent those of AAMI.
**********************************************************************

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


Re: sourcing from property files

Posted by Ch...@aami.com.au.
"Wayne Fay" <wa...@gmail.com> wrote on 21/05/2008 00:22:05:

> On Tue, May 20, 2008 at 1:39 AM,  <Ch...@aami.com.au> wrote:
> > Is it possible to actually take a version number from a property
> > file and have that used in the POM rather than the other way around?
> 
> Not natively. But you could write a plugin to do it or use the
> Properties Plugin from the Codehaus sandbox:
> https://svn.codehaus.org/mojo/trunk/sandbox/properties-maven-plugin/
> 
> "The Properties Maven Plugin is here to make life a little easier when
> dealing with properties. It provides goals to read and write
> properties from files."
> 
> > Speaking of which how/can we get the version number in the pom
> > written to a property file that is then used at runtime?
> 
> You just need to set up a file with the token ${version} in it and
> tell Maven to filter it during resource processing. Alternatively, it
> seems that the Properties plugin would also handle this.

Thank you very much wayne for the detailed response. It is exactly what I 
was looking for.

-Chris


**********************************************************************
CAUTION - This message is intended for the addressee named above. It may contain privileged or confidential information. 

If you are not the intended recipient of this message you must: 
- Not use, copy, distribute or disclose it to anyone other than the addressee;
- Notify the sender via return email; and
- Delete the message (and any related attachments) from your computer immediately.

Internet emails are not necessarily secure. Australian Associated Motors Insurers Limited ABN 92 004 791 744 (AAMI), and its related entities, do not accept responsibility for changes made to this message after it was sent.

Unless otherwise stated, views expressed within this email are the author's own and do not represent those of AAMI.
**********************************************************************

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


Re: sourcing from property files

Posted by Wayne Fay <wa...@gmail.com>.
On Tue, May 20, 2008 at 1:39 AM,  <Ch...@aami.com.au> wrote:
> Is it possible to actually take a version number from a property
> file and have that used in the POM rather than the other way around?

Not natively. But you could write a plugin to do it or use the
Properties Plugin from the Codehaus sandbox:
https://svn.codehaus.org/mojo/trunk/sandbox/properties-maven-plugin/

"The Properties Maven Plugin is here to make life a little easier when
dealing with properties. It provides goals to read and write
properties from files."

> Speaking of which how/can we get the version number in the pom
> written to a property file that is then used at runtime?

You just need to set up a file with the token ${version} in it and
tell Maven to filter it during resource processing. Alternatively, it
seems that the Properties plugin would also handle this.

Wayne

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