数码资讯
如何配置 maven 的 resources 的资源复制为强制覆盖???
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
如果maven复制的资源中,包含同名的资源,往往需要后面的复制覆盖前面的复制,但是maven的资源复制默认是不覆盖的。
比如:
<resources>
<!-- 复制资源 -->
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
<!-- 复制特定 profile 的资源 -->
<resource>
<directory>src/main/resources/${resource_dir}</directory>
<!--<filtering>true</filtering>-->
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
这种情况下,可以通过配置 maven.resources.overwrite 的属性值来变更这个行为:
<properties>
<maven.resources.overwrite>true</maven.resources.overwrite>
</properties>
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。