Had the exact same problem! AFAIK the only way around this is to have a dedicated module with the correct dependencies in place. Unfortunately I could not figure out how to access plain files (not just the artifacts or sources) from the assembly then.

Sad story as it is - in the end I did the assembly with a shell script ...instead of spending even more time on maven.

If you find good solution - please let me know.

cheers
--
Torsten

On 14.06.2007, at 01:25, Francois Fernandes wrote:


Hi list,

and again a problem using the maven-assembly-plugin. I've got a multimodule build with a custom assembly descriptor I would like to execute the assembly plugin when the install phase is beeing executed. Unfortunately this doesn't work as expected. The assembly is beeing defined and attached to the lifecycle in the parent pom. When invoking the install phase the parent is processed and the assembly:attach is called immediately after the install of the parent pom. That means that the submodules (which I'm referencing in the assembly descriptor) haven't been invoked. I've attached the resulting error to the bottom of this mail.

Thx for any help

The Parent POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http:// maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>my.group</groupId>
  <artifactId>parent</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>parent</name>
  <modules>
  <module>client</module>
  <module>shared</module>
  <module>server</module>
  </modules>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <inherited>false</inherited>
        <executions>
          <execution>
            <id>build-distribution</id>
            <phase>install</phase>
            <goals>
              <goal>attached</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>dist.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>


This is the resulting output:

[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   parent
[INFO]   shared
[INFO]   client
[INFO]   server
[INFO] ---------------------------------------------------------------------- ------
[INFO] Building parent
[INFO]    task-segment: [install]
[INFO] ---------------------------------------------------------------------- ------
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing C:\temp\parent\pom.xml to ...\home\.m2\repository \my\group\parent\1.0-SNAPSHOT\parent-1.0-SNAPSHOT.pom
[INFO] [assembly:attached {execution: build-distribution}]
[INFO] Reading assembly descriptor: C:\temp\parent\dist.xml
[INFO] ---------------------------------------------------------------------- --
[ERROR] BUILD ERROR
[INFO] ---------------------------------------------------------------------- -- [INFO] Failed to create assembly: Artifact: my.group:server:jar:1.0- SNAPSHOT (included by module) does not have an artifact with a file. Please ensure the
package phase is run before the assembly is generated.

[INFO] ---------------------------------------------------------------------- --
[INFO] For more information, run Maven with the -e switch
[INFO] ---------------------------------------------------------------------- --
[INFO] Total time: 2 seconds
[INFO] Finished at: Thu Jun 14 01:15:57 CEST 2007
[INFO] Final Memory: 7M/14M
[INFO] ---------------------------------------------------------------------- --


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to