Great! Thanks for the hint!
Stefan
On Aug 19, 2008, at 12:22 AM, Jean-Marc Desprez wrote:
Hi,
I found a solution to this problem after reading this page :
http://docs.codehaus.org/display/MAVENUSER/Assembly+Plugin
Modification for the main project (important part is the executions
block) :
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<descriptors>
<descriptor>${basedir}/assembly/
livraison.xml</descriptor>
</descriptors>
</configuration>
<!-- important part is here -->
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
Important : Now, with this configuration, you must launch "mvn ...
package" and not "mvn .... assembly:assembly"
Bye
2008/7/25 Jean-Marc Desprez <[EMAIL PROTECTED]>
Hi,
I have four projects under maven.
I want to be able to run "assembly:assembly" on each projects with
minimum effort.
So I had create a main project with this configuration :
...
<modules>
<module>../aaa</module>
<module>../zzz</module>
<module>../eee</module>
<module>../rrr</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<descriptors>
<descriptor>${basedir}/assembly/
livraison.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
On each child, I add this two pieces of code :
<parent>
<groupId>the.group</groupId>
<artifactId>main</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../main/pom.xml</relativePath>
</parent>
and
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<!-- see configuration on parent's project -->
</plugin>
...
</plugins>
</build>
Maven help (http://maven.apache.org/pom.html#Plugin_Management)
say : Plugin Management contains plugin elements in much the same
way, except that rather than configuring plugin information for this
particular project build, it is intended to configure project builds
that inherit from this one.
But, "assembly:assembly" on the main's pom.xml throw an error :
[INFO] [assembly:assembly]
[INFO] Reading assembly descriptor: /path/to\main/assembly/
livraison.xml
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error reading assemblies: Error locating assembly descriptor
Which is completly normal because I do not have assembly descriptor
for the main project.
Plus, the assembly is not done on the childs projects
How can I run assembly:assembly only on the childs projects ??
Thanks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101tec Inc.
Menlo Park, California, USA
http://www.101tec.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]