为什么maven-assembly-plugin在我的zip中多次使用相同的依赖?

时间:2022-08-31 08:45:36

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)

没有什么特别的,但现在我的依赖项被多次包含在zip文件中(完全相同的文件)。为什么会发生这种情况,我该如何防止这种情况发生? (我想也许使用useTransitiveFiltering会阻止它,但是没有)

To illustrate how it looks within the zip file here a illustration:

为了说明它在zip文件中的外观如下:

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

截图Zip文件http://www.openscada.org/AtlantisMavenBuild?action=AttachFile&do=get&target=multiple-deps.png

1 个解决方案

#1


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.

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

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

#1


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.

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

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