我有一个 Maven 多模块项目,这在组装:组装阶段让我头疼。
我有一个模块,其中定义了一个程序集,当我使用该 pom 调用 mvn assembly: assembly 时,它可以正常工作。
当我上一级到父 pom 并调用 assembly: assembly 时,问题就开始了……一切都很顺利,直到最后一步出现“原因:读取程序集时出错:找不到程序集描述符”。指向parent.pom,其中除了项目中的模块列表之外什么都没有。
有什么建议吗(我已经尝试过使用 google 和 -e 进行常规调试)?
谢谢 安迪
最佳答案
由于您没有提供答案,因此您需要将程序集创建附加到package阶段:
<build>
<plugins>
<!-- Create assembly -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-4</version>
<configuration>
<descriptors>
<descriptor>...</descriptor>
</descriptors>
...
</configuration>
<!-- Attach the creation of the assembly to the package phase. -->
<executions>
<execution>
<id>assemble</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
关于java - Maven 组装问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1688209/