gpt4 book ai didi

maven - 当 Maven 创建 zip 文件时,程序集 ID 被附加

转载 作者:行者123 更新时间:2023-12-04 16:25:47 25 4
gpt4 key购买 nike

xml 和 pom.xml,它创建 jar 文件,然后使用一些 Artifact (包括 jar 文件)压缩文件。但是当我运行 maven install zip 文件时,它被创建为 GenerateMissingUsersReport-bin.zip 而我希望它创建为 GenerateMissingUsersReport.zip。我设置为假。但没有区别。

任何指针?

这是 dep.xml

<id>bin</id>  
<baseDirectory>../</baseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
<include>NOTICE*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/classes</directory>
<includes>
<include>plugin.xml</include>
</includes>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>

这是 pom.xml
<finalName>GenerateMissingUsersReport</finalName>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<finalName>GenerateMissingUsersReport</finalName>
<appendAssemblyID>false</appendAssemblyID>
<descriptor>src/assembly/dep.xml</descriptor>
</configuration>
<executions>
<execution>
<id>make-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>plugin.xml</exclude>
</excludes></configuration>
</plugin>

最佳答案

在 pom 的配置元素下添加以下行

<appendAssemblyId>false</appendAssemblyId>

还要确保您使用最新版本的程序集插件
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>

关于maven - 当 Maven 创建 zip 文件时,程序集 ID 被附加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30806699/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com