在 Maven 战争覆盖期间覆盖资源
据我所知,maven-war-plugin 永远不会覆盖覆盖目标中已存在的文件。例如,如果我有一个 war
A,它依赖于 war
B,两者都包含位于 src/main/resources/some.xml
的某些资源,生成的 A.war
将包含来自 some.xml >一个项目。
如何指示 maven-war-plugin
优先使用依赖项 (B) 中的资源而不是原始资源 (A)?
As I've gathered, maven-war-plugin
never overwrites files which already exist in the target of an overlay. For example, if I have a war
A which has a dependency on a war
B, both of which contain some resource located at src/main/resources/some.xml
, the resulting A.war
will contain the some.xml
from the A project.
How do I instruct the maven-war-plugin
to favor the resources from the dependency (B) over the original ones (A)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅 http://maven.apache.org/plugins/maven-war-插件/overlays.html:
我猜这不是最终决定,而是一个起点。
See http://maven.apache.org/plugins/maven-war-plugin/overlays.html:
Guess that's not the final desicion, but a point to start at.
您可以使用 maven-resources 插件将文件复制到所需位置。战争爆发之前或之后。
You can use maven-resources plugin to copy a file to the desired location. Before or after a war has been built.