In m2, you just turn filtering on for resources in your pom. Assuming
you've put the files being filtered in the default place
(src/main/resources), you may not have anything about resources in your
pom already, so you'll need to add everything about this resource
directory:
<project>
...
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
With that, any resource file that contains ${pom.version} will replace
that text with the value from the version element of the pom. The same
is true for other values in the pom. I don't think values from
settings.xml are available, however. Someone else can correct me if I'm
wrong.
..David..
-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey
Sent: Wednesday, October 19, 2005 9:05 AM
To: [email protected]
Subject: [m2 & m1]Inject POM values into application
What is the best practice for injecting POM values into the application?
For example, I want my application to get it's version (in pom.xml),
releaseDate and productionMode (in settings.xml) variables feeded in the
build process.
In m1 I made a general resources template and I replaced tokens in it
and put a copy of that file in the target/classes after the resources
where copied. I did this in maven.xml of course.
Surely there must be a better way in maven 2?
Thanks for any and all help.
--
With kind regards,
Geoffrey De Smet
---------------------------------------------------------------------
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]