配置动态资源

This commit is contained in:
shuzheng 2016-10-11 20:46:34 +08:00
parent d3795b45cb
commit e4ddfd75c1
5 changed files with 41 additions and 0 deletions

View File

@ -40,7 +40,44 @@
<type>jar</type>
</dependency>
</dependencies>
<profiles>
<profile>
<id>dev</id>
<properties>
<env>dev</env>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>test</id>
<properties>
<env>test</env>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<env>prod</env>
</properties>
</profile>
</profiles>
<build>
<finalName>cms-web</finalName>
<filters>
<filter>src/main/resources/profiles/${env}.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>src/main/resources/profiles/*</exclude>
</excludes>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>

View File

@ -0,0 +1 @@
env=${profile.env}

View File

@ -0,0 +1 @@
profile.env=dev

View File

@ -0,0 +1 @@
profile.env=prod

View File

@ -0,0 +1 @@
profile.env=test