为什么 maven- assembly-plugin 在我的 zip 中多次放置相同的依赖项?

发布于 2024-07-18 17:26:02 字数 1775 浏览 3 评论 0原文

我将一个程序集描述符放在一起

<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:

Screenshot Zip File http://www.openscada.org/AtlantisMavenBuild?action=AttachFile&do=get&target=multiple-deps.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城缀染半城烟沙 2024-07-25 17:26:02

这是程序集插件中的一个错误。 大约一年前我也注意到了这一点。 最新版本的程序集插件没有这个问题。 我建议将您正在使用的程序集插件的版本更新为 2.2 beta 3。它应该可以解决您的问题。

  <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <groupId>org.apache.maven.plugins</groupId>
      <version>2.2-beta-3</version>
  </plugin>

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.

  <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <groupId>org.apache.maven.plugins</groupId>
      <version>2.2-beta-3</version>
  </plugin>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文