【发布时间】:2015-09-20 19:35:47
【问题描述】:
我遇到了这里描述的相同问题:How can I force maven to leave the version number out of dependency file names?,但使用了 WAR 插件。环顾四周,但没有找到任何解决方案。
【问题讨论】:
标签: maven dependencies version war
我遇到了这里描述的相同问题:How can I force maven to leave the version number out of dependency file names?,但使用了 WAR 插件。环顾四周,但没有找到任何解决方案。
【问题讨论】:
标签: maven dependencies version war
您可以使用maven-war-plugin 定义file name mappings。这是通过插件配置的outputFileNameMapping 完成的:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping>
</configuration>
</plugin>
使用此配置,WEB-INF/lib 中的每个依赖项都将被删除其版本。
【讨论】: