I suggest that you use the build profiles.
For each profile, you will define a specific Spring configuration:
<profiles>
<profile>
<id>integration</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>env</name>
<value>integration</value>
</property>
</activation>
<!-- Specific information for this profile goes here... -->
</profile>
<profile>
<id>production</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>env</name>
<value>production</value>
</property>
</activation>
<!-- Specific information for this profile goes here... -->
</profile>
...
You will then activate one profile or the other by setting the parameter env : -Denv=integration
for the first profile, -Denv=production
for the second profile.
In each profile
block, you can specify any information specific to your environment. You can then specify properties
, plugins
, and so on. In your case, you may change the configuration of the resources plugin in order to include the adequate Spring configuration. For example, in integration profile, you can specify where Maven will search the Spring configuration file:
<profile>
<id>integration</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>env</name>
<value>integration</value>
</property>
</activation>
<build>
<resources>
<resource>/path/to/integration/spring/spring.xml</resource>
</resources>
</build>
</profile>