Yes. Put a property file in /src/main/resources containing:

Version= ${project.version}

Then enable filtering in the <resources> section of your pom for
/src/main/resources and this file will end up in /target/classes with
the version correctly filtered.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 27, 2008 3:14 PM
To: [email protected]
Subject: Text Substitution


Does maven 2 provide a text substitution feature?
I've looked through the docs, but not found anything.

Specifically I would like to copy the version
(<version>1.0.10</version>) from the pom into a (xml) file
in our application so the version can be displayed in the
application.

Currently we have to manually update both the version in the
pom and the xml file, which although not difficult is an
opportunity to make an error if you not paying attention.

I would be great to be able to place a magic string (e.g.
{mvn.pom.version} or something) that when mvn is copying
files to the target directory will replace with the version
from the pom.

I guess in general arbitrary string replacement might be
useful too?

Cheers and thanks for a great tool

Simon

PS: I tried to send this from my work email address but it
was rejected with:

Reporting-MTA: dns; mail.metering.co.nz

Final-recipient: RFC822; [email protected]
Action: failed
Status: 5.0.0
Remote-MTA: dns; apache.org
X-Supplementary-Info: <apache.org #5.0.0 smtp;552 spam score
(5.2) exceeded
 threshold>

---------------------------------------------------------------------
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]

Reply via email to