, .
- Spring
PropertyPlaceholderConfigurer - Maven ( Dev),
- (TeamCity )
- Maven
, , , , , , , .
, , .
/.
, .
Maven, profile pom, development, , env. , , POM Maven Compiler Maven Tomcat.
, , Tomcat IntelliJ
env. env
classpath*:dev-common.properties.
-
.
env PropertyPlaceholderConfigurer
1 - Maven profile pom.xml:
a profile pom:
<profile>
<id>development</id>
<activation>
<property>
<name>env</name>
<value>development</value>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
...
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
2 - :
Spring, a PropertyPlaceholderConfigurer. build classpath .
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>
${env}
</value>
</list>
</property>
3. :
Spring , , PropertyPlaceholderConfigurer. @ContextConfiguration(locations = {"classpath:test-dataexchange-application-context.xml"}) @RunWith(SpringJUnit4ClassRunner.class)).
PropertyPlaceholderConfigurer , :
<bean id="testpropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:dev-local-common.properties</value>
</list>
</property>
:
Team City , ,
, . , .
, , development. ,
.
:
- Maven Project.
- Maven 3
profile pom settings.xml( Maven) , , settings.xml