## Maven profile配置

pom.xml中，可以配置testproduct两个profile，分别对应测试环境和正式环境。这里也可以根据具体情况自定义。

## Spring Framework（非Spring Boot）整合Maven profile

### Spring Framework如何启用一个profile

Spring启用某个profile有多种方式（摘自官方文档：https://docs.spring.io/spring/docs/5.1.5.RELEASE/spring-framework-reference/core.html#beans-definition-profiles-enable ）：

Activating a profile can be done in several ways, but the most straightforward is to do it programmatically against the Environment API which is available through an ApplicationContext.
In addition, you can also declaratively activate profiles through the spring.profiles.active property, which may be specified through system environment variables, JVM system properties, servlet context parameters in web.xml, or even as an entry in JNDI.

• 通过代码设置：ApplicationContext.getEnvironment().setActiveProfiles("yourProfile")
• 通过系统环境变量spring.profiles.active值来设置
• 通过JVM系统属性spring.profiles.active值来设置
• 通过web.xml中的context-param来设置