If you're trying to use <moduleSets/>, then you may need to execute like
this:

mvn package assembly:assembly

The problem is in the way the Maven 2.0 lifecycle is setup. More
specifically, the top-level POM is probably used as a <parent/> in multiple
of the modules (or all of them). This means that the goals specific to the
parent POM's build will run ahead of the modules, to ensure that the parent
is available...however, it also means that the assembly:assembly mojo will
run before any of the modules have been built.

This sort of use case is something we're hoping to address in 2.1.

-john

On 7/25/06, Damien Viel <[EMAIL PROTECTED]> wrote:

Hi,

I've tried to implement the solution proposed in this link
http://maven.apache.org/plugins/maven-assembly-plugin/examples/index.html.
and I've got the folloing stack :

Embedded error: You must set at least one file.
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error creating
assembly
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:559)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(
DefaultLifecycleExecutor.java:488)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:458)
         at

org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:306)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:219)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:140)
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
         at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:39)
         at
sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
         at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error
creating assembly
         at
org.apache.maven.plugin.assembly.AbstractDirectoryMojo.createDirectory(
AbstractDirectoryMojo.java:72)
         at
org.apache.maven.plugin.assembly.AbstractDirectoryMojo.execute(
AbstractDirectoryMojo.java:41)
         at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:412)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:534)
         ... 16 more
Caused by: org.codehaus.plexus.archiver.ArchiverException: You must set
at least one file.
         at
org.codehaus.plexus.archiver.dir.DirectoryArchiver.createArchive(
DirectoryArchiver.java:56)
         at
org.apache.maven.plugin.assembly.AbstractAssemblyMojo.createArchive(
AbstractAssemblyMojo.java:383)
         at
org.apache.maven.plugin.assembly.AbstractDirectoryMojo.createDirectory(
AbstractDirectoryMojo.java:63)
         ... 19 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 11 seconds
[INFO] Finished at: Tue Jul 25 19:04:17 CEST 2006
[INFO] Final Memory: 11M/20M
[INFO]
------------------------------------------------------------------------

Can anyone have a idea ?

Damien

Edwin Punzalan a écrit :
>
> jar-with-dependencies won't work for a "pom" project.
>
> You need to use <moduleSets>...
>
> Please see
>
http://maven.apache.org/plugins/maven-assembly-plugin/examples/index.html.
>
>
>
> Damien Viel wrote:
>> Hi all,
>>
>> I still have problem with the assembly plugin. :(
>>
>> I'm trying to build a zip file of my project which includes the
>> modules's jars and there dependencies.
>>
>> With the standard goals "jar-with-dependencies" it works fine on each
>> modules. But when I call the goal from the parent pom, the assembly is
>> empty.
>>
>> I'm using 2.2-SNAPSHOP version of the assembly plugin.
>>
>> My project struture is as follows :
>>
>> * Parent Projet
>> * pom.xml
>> *-- Module 1
>>     * pom.xml
>> *-- Module 2
>>     * pom.xml
>>
>> Here is my descriptor file :
>>
>> <assembly>
>>   <id>jar-with-dependencies</id>
>>   <formats>
>>    <format>zip</format>
>>    <format>dir</format>
>>   </formats>
>>   <includeBaseDirectory>false</includeBaseDirectory>
>>   <fileSets>
>>     <fileSet>
>>       <directory>target/classes</directory>
>>       <outputDirectory>/</outputDirectory>
>>     </fileSet>
>>   </fileSets>
>>   <dependencySets>
>>     <dependencySet>
>>       <outputDirectory>/</outputDirectory>
>>       <unpack>false</unpack>
>>       <scope>runtime</scope>
>>     </dependencySet>
>>   </dependencySets>
>> </assembly>
>>
>>
>> Thank's all
>>
>> Damien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
--------------------------------------------------
Damien Viel | +33 1 41 97 83 20 | [EMAIL PROTECTED]
--------------------------------------------------
         | http://www.improve-foundations.com
__/ \__ | http://www.improve.fr
improve | http://www.application-servers.com
/_____\-| http://www.improve-technologies.com
--------------------------------------------------

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


Reply via email to