为什么 maven- assembly-plugin 在我的 zip 中多次放置相同的依赖项?
我将一个程序集描述符放在一起
<assembly>
<id>all</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<includes>
<include>org.openscada.atlantis:org.openscada.atlantis.core.common</include>
<include>org.openscada.atlantis:org.openscada.atlantis.net.base</include>
<include>org.openscada.atlantis:org.openscada.atlantis.core.net.base</include>
... some more ...
<include>org.openscada.atlantis:org.openscada.atlantis.spring.components</include>
</includes>
<binaries>
<includeDependencies>true</includeDependencies>
<outputDirectory>bin</outputDirectory>
<unpack>false</unpack>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<useTransitiveFiltering>true</useTransitiveFiltering>
</dependencySet>
</dependencySets>
</binaries>
</moduleSet>
</moduleSets>
</assembly>
,没什么特别的,但现在我的依赖项多次包含在 zip 文件中(完全相同的文件)。 为什么会发生这种情况,我该如何防止这种情况发生? (我想也许使用 useTransitiveFiltering 会阻止它,但不会)
为了说明它在 zip 文件中的外观,这里有一个插图:
截图压缩文件 http://www.openscada.org/AtlantisMavenBuild?action=AttachFile&do=get&target=multiple-deps.png
I put together an assembly descriptor
<assembly>
<id>all</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<includes>
<include>org.openscada.atlantis:org.openscada.atlantis.core.common</include>
<include>org.openscada.atlantis:org.openscada.atlantis.net.base</include>
<include>org.openscada.atlantis:org.openscada.atlantis.core.net.base</include>
... some more ...
<include>org.openscada.atlantis:org.openscada.atlantis.spring.components</include>
</includes>
<binaries>
<includeDependencies>true</includeDependencies>
<outputDirectory>bin</outputDirectory>
<unpack>false</unpack>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<useTransitiveFiltering>true</useTransitiveFiltering>
</dependencySet>
</dependencySets>
</binaries>
</moduleSet>
</moduleSets>
</assembly>
nothing special, but now my dependencies are included within the zip file multiple times (the exact same files). Why does this happen, and how can I prevent this? (I thought maybe the use of useTransitiveFiltering would prevent it, but no)
To illustrate how it looks within the zip file here a illustration:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是程序集插件中的一个错误。 大约一年前我也注意到了这一点。 最新版本的程序集插件没有这个问题。 我建议将您正在使用的程序集插件的版本更新为 2.2 beta 3。它应该可以解决您的问题。
That is a bug in the assembly plugin. I also noticed that about a year ago. The latest version of the assembly plugin does not have the problem. I would recommend updating the version of the assembly plugin you are using to 2.2 beta 3. It should resolve your issue.