Some observations...
I've created a scratch project with four modules to try and understand
what is going on here.
I am configuring the assembly plugin in two different ways:
1. via the parent POM [1]
2. via the command line [2]
The two configuration methods are producing the same result [3] (a
good thing!) but they take different paths to get there (a confusing
thing :).
Method 1 seems to be binding the assembly to the package phase of the
parent project only. That is, Maven runs package at the parent level
and then runs the assembly without descending into the modules.
Method 2 seems to be binding the assembly to the package phase of the
parent project after packaging the entire reactor. That is, Maven
descends into each module, runs package and then attempts to run the
assembly from the parent.
Method 2 makes sense as assembly:assembly is bound to the package phase.
Method 1 kinda makes sense as I am specifically binding the assembly
to the package phase in the parent POM. Shouldn't the entire reactor
be packaged also though?
Anyway, should these two configuration methods behave in the same manner?
Apart from that, what is the cause of the assembly plugin exception?
In at least one case (Method 2) the module artifacts are definitely
created.
I can forward debug traces of each Maven run if anyone is interested.
They are quite long however.
Thanks
Listing 1: assembly plugin POM configuration
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>package-all</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
<inherited>false</inherited>
<configuration>
<descriptors>
<descriptor>src/main/assembly/package-all.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Listing 2: assembly plugin command line configuration (plugin
configuration removed from POM)
$ mvn -X assembly:assembly -Ddescriptor=src/main/assembly/package-all.xml
Listing 3: assembly plugin exception
Caused by: org.apache.maven.plugin.MojoExecutionException: Included
module: com.scratch:scratch-moduleA:jar:1.0-SNAPSHOT does not have an
artifact with a file.
Please ensure the package phase is run before the assembly is generated.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]