You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Terala, Satish (IS Consultant)" <ST...@consultantemail.com> on 2007/03/01 00:16:13 UTC
Reading a property that is initialized in profile in POM
Hello
I am struggling with possibly that's a simple issue. I need to apply
filters to my resources based on the environment that I build for. For
example if building for local I want to use local.filter.properties as
the filter property file .
I am trying to do this by applying a profile for each environment.
But some how the variable for which the value is set inside the profile
definition still comes as a variable inside the build element. Below is
the snippet of the code, can some one please help out. I think I am
making some basic mistake.
-Satish
<build>
<filters>
<filter>src/main/filters/${envName}.filter.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>local</id>
<activation>
<property>
<name>target-env</name>
<value>local</value>
</property>
</activation>
<properties>
<envName>local</envName>
</properties>
</profile>
</profiles>