gpt4 book ai didi

Maven 程序集 :single Error reading assemblies: No assembly descriptors found

转载 作者:行者123 更新时间:2023-12-01 02:52:35 24 4
gpt4 key购买 nike

我正在将我的 Maven 构建从 2.2-beta5 移动到 2.2。根据文档 assembly:assembly 已被弃用,我试图用 assembly:single 替换它。我一直在尝试各种配置,但仍然无法正常工作,我通常会收到以下错误:读取程序集时出错:未找到程序集描述符。

   <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>assembly</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${env}.${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<filters>
<filter>src/main/filters/${env}/${build.env}/filter-common.properties</filter>
<filter>src/main/filters/${env}/${build.env}/filter-${user.name}.properties</filter>
</filters>
<descriptors>
<descriptor>src/main/assembly/distribution.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>

使用 执行: mvn clean package assembly:single install antrun:run

我也尝试将配置移出执行标记,但这会导致同样的问题。从命令中删除 assembly:single 时,我没有执行插件。请让我知道执行此插件的正确方式是什么?

非常感谢

最佳答案

经过一些试验和错误,我注意到通过将它添加到包阶段,它会工作得很好:

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${env}.${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<filters>
<filter>src/main/filters/${env}/${build.env}/filter-common.properties</filter>
<filter>src/main/filters/${env}/${build.env}/filter-${user.name}.properties</filter>
</filters>
<descriptors>
<descriptor>src/main/assembly/distribution.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>

关于Maven 程序集 :single Error reading assemblies: No assembly descriptors found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4376145/

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