I use the following setup to have maven inject filtered property values into
my application configuration files, such as the Spring
applicationContext.xml:
File System:
src/main/filters/filter-test.properties
src/main/filters/filter-live.properties
src/main/resources/applicationContext.xml
and in my pom.xml I do this:
// use profiles to setup env property value as either test or live
...
<build>
<filters>
<filter>${basedir}/src/main/filters/filter-${env}.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</build>
Now this works fine, but I would like to have my filter property files also
have properties entered into my pom.xml itself.
For example, later in my pom.xml I use a weblogic deployment plugin which
deploys my war to the server. This of course requires properties which are
environment specific. I wish I could have these properties in my separate
filter-<env>.properties files as well, because right now the only thing I
seem to get working is if I set these properties within my profiles setup. I
dont want it in the pom.xml though, I want maven to load them from my
environment specific property file.
Is there any way I can do this?
So that when I configure my weblogic plugin with for example:
<adminServerHostName>${weblogic.host.name}</adminServerHostName>
And I ran the pom.xml with my "test" profile activated, then maven should
pull the value of that property from my filter-test.properties file:
weblogic.host.name=testserver
or whatever.
--
View this message in context:
http://maven.40175.n5.nabble.com/How-do-I-add-filtered-properties-to-my-pom-xml-tp4406945p4406945.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]