我正在将我的maven版本从2.2-beta5移动到2.2。根据文档程序集:不推荐使用程序集,我试图用程序集替换它: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:单次安装antrun:run
我也尝试将配置移出执行标记,但这会导致同样的问题。删除程序集时:单个命令插件我执行snot。请告诉我执行此插件的核心方法是什么?
非常感谢
答案 0 :(得分:3)
经过一些试验和错误后,我注意到通过将其添加到包阶段,它可以正常工作:
<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>