You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Paul Gier <pg...@redhat.com> on 2007/03/09 15:58:15 UTC

Multimodule assembly plugin question

I have a project with multiple modules, and I would like to assemble the
classes of the modules into a single jar file.
If the names of the modules (and directories) match the artifact ID, the
assembly works fine.  But if the artifactId does not match the module
name, then the files are not picked up.  Is there a way to configure
this to work with the different names?  Or do I need to just rename my
modules or artifacts so that they match?

Thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multimodule assembly plugin question

Posted by Armin Ehrenfels <Ar...@t-online.de>.
Hi Paul,

for example, in your assembly.xml, you could refer to the target class 
directories of your modules  like this:

<assembly>
    <id>example</id>
    <formats>
        <format>jar</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <fileSets>
        <fileSet>
            <directory>module1/target/classes/top_module1</directory>
            <outputDirectory>top_module1</outputDirectory>
        </fileSet>
        <fileSet>
            <directory>module2/target/classes/top_module2</directory>
            <outputDirectory>top_module2</outputDirectory>
        </fileSet>
        <fileSet>
            <directory>module3/target/classes/top_module3</directory>
            <outputDirectory>top_module3</outputDirectory>
        </fileSet>
        <fileSet>
             etc.
        </fileSet>
  </fileSets>
</assembly>

More on this can be found at 
http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html.

HTH

Armin

Paul Gier wrote:

>I have a project with multiple modules, and I would like to assemble the
>classes of the modules into a single jar file.
>If the names of the modules (and directories) match the artifact ID, the
>assembly works fine.  But if the artifactId does not match the module
>name, then the files are not picked up.  Is there a way to configure
>this to work with the different names?  Or do I need to just rename my
>modules or artifacts so that they match?
>
>Thanks!
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org