<profiles>
<profile>
<!-- 开发环境 -->
<id>dev</id>
<properties>
<environment>dev</environment><!-- 节点名字environment是自己随意取的 -->
</properties>
<activation>
<activeByDefault>true</activeByDefault><!-- 默认激活该profile节点-->
</activation>
</profile>
<profile>
<!-- 生产环境 -->
<id>pre</id>
<properties>
<environment>pre</environment>
</properties>
</profile>
<profile>
<!-- 生产环境 -->
<id>prod</id>
<properties>
<environment>prod</environment>
</properties>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot-version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>process-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/resources/templates/common/${environment}</directory>
<includes>
<include>common.html</include>
</includes>
</resource>
</resources>
<outputDirectory>${project.build.directory}/classes/templates/common</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>