tags:

views:

137

answers:

2

Hi,

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.

Any suggestions (I have tried google and general debugging with -e) ?

Thanks Andy

A: 

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.

Andrew Norman
+2  A: 

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>
romaintaz
Doh .. I knew I forgot to do something. That is pretty much character for character what I added to the module pom.Thanks
Andrew Norman