maven配置profile需要注意的

需要在配置文件的build中将resource的filter设置为true,如下红色部分,不设置的话是不会生效的。

<build>
<finalName>portal-cms-controller</finalName>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<!--允许资源文件中的某些值用变量值替换-->
<filtering>true</filtering>
</resource>
</resources>
</build>

posted on 2017-09-24 19:49  xiaopang1983  阅读(377)  评论(0编辑  收藏  举报