I believe it would work if you changed a little bit the way you configure the filters... you could have a profile for each filter you want to use (instead of using the ${env} property to determine the filter you will use).. so it would be something like:
<profile> <id>env.test</id> <activation> <property> <name>env</name> <value>test</value> </property> </activation> <build> <fillters> <filter>${basedir}/src/main/filters/filter-test.properties</filter> </filters> </build> </profile> <profile> <id>env.live</id> <activation> <property> <name>env</name> <value>live</value> </property> </activation> <build> <fillters> <filter>${basedir}/src/main/filters/filter-live.properties</filter> </filters> </build> </profile> This way, when ${env} is evaluated to "test", the "env.test" profile will be activated and properties defined in ${basedir}/src/main/filters/filter-test.properties will be available. While when ${env} is evaluated to "live", the "env.live" profile will be activated and properties defined in ${basedir}/src/main/filters/filter-live.properties will be available. On Wed, May 18, 2011 at 1:14 PM, trant <mmo...@webatrocity.com> wrote: > 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: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >