开发者

Maven Assembly Problem

I have a maven multiple-module project, which is giving me headaches in the assembly:assembly phase.

I have a module which has an assembly defined in it which works fine when I invoke mvn assembly:assembly using that pom.

The problems start when I go up one level to the parent pom and invoke assembly:assembly ... everything goes fine until the last step when I get "Reason: Error reading assemblies: No assembly descriptors found." pointing to the parent.pom where I nothing other than a list of the modules in the project.

A开发者_开发问答ny suggestions (I have tried google and general debugging with -e) ?

Thanks Andy


As you didn't provide the answer, here is how you need to attach the assembly creation to the package phase:

<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>


Ok ... fixed it.

I hadn't tied the assembly plugin to any lifecycle phases. I have now perform the assembly:assembly during the package phase and it all works now.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜