It is our policy to only build 1 deployable jar. all environment-specific configurations are kept separate, and we build them all together at once. so under our current Ant process, we have a properties file for each environment, loop over them, and create a set of config files for each environment.
In my current POM XML, I'm able to build only one profile supplied at the Command-line. Is it possible to achieve through Maven?
Here are some of the relevant part of POM.xml
<!-- Define profiles here and make DEV as default profile -->
<profiles>
<!-- dev Profile -->
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- qa Profile -->
<profile>
<id>qa</id>
<properties>
<env>qa</env>
</properties>
</profile>
<!-- prod Profile -->
<profile>
<id>prod</id>
<properties>
<env>prod</env>
</properties>
</profile>
</profiles>
...
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<filters>
<filter>env/${env}.properties</filter>
</filters>
<outputDirectory>${project.build.directory}/config/${env}
</outputDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/config/default
</directory>
<includes>
<include>*.xml</include>
<include>*.properties</include>
</includes>
</resource>
.....
Thanks, Prabhjot