You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Paolo Bacci <pa...@longadata.com> on 2006/11/22 20:53:28 UTC

Assembly plugin for multi module project

Hi,

I need to make an assembly of my project to make tests on windows. I read
this manual
http://maven.apache.org/plugins/maven-assembly-plugin/examples/multimodule/module-binary-inclusion-simple.html
but i keep getting the same error message:

[INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Error creating assembly: You must set at least one file.
>
> [INFO]
> ------------------------------------------------------------------------


My project is set up as:

Parent
child1
child2
child3

I can build the .jar with "mvn package" command, but when I try to run mvn
assembly:assembly, it returns me the error from above.
I've tried using the default descriptor, but it creates an empty file, so
I've searched for an descriptor example and after that started using this
descriptor:

<assembly>
>   <id>bin</id>
>     <formats>
>         <format>tar.gz</format>
>     </formats>
>    <includeBaseDirectory>false</includeBaseDirectory>
>      <moduleSets>
>       <moduleSet>
>        <includes>
>         <include>com.longadata.scapintegration.api</include>
>         <include>com.longadata.scapintegration.core</include>
>         <include>com.longadata.scapintegration.model</include>
>        </includes>
>        <binaries>
>
> <outputDirectory>modules/scap-integration-branch</outputDirectory>
>          <includeDependencies>true</includeDependencies>
>          <unpack>false</unpack>
>        </binaries>
>       </moduleSet>
>      </moduleSets>
> </assembly>


Both of them are not giving me the expected result.
Does anybody has any clue about what could be possibly wrong?

thx,
Paolo Bacci.

Re: Assembly plugin for multi module project

Posted by pjungwir <ma...@9stmaryrd.com>.
Hello,

I hit that error once! It is very confusing, but it means that the resulting
tarball (or whatever) would be empty. In other words, Maven isn't finding
any files to include in the assembly. I guess there is something wrong with
your <moduleSet>, but I don't know; I haven't used this plugin on
multi-module projects.

Paul



-- 
View this message in context: http://www.nabble.com/Assembly-plugin-for-multi-module-project-tf2685658s177.html#a7606167
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Assembly plugin for multi module project

Posted by Timo Wolf <wo...@in.tum.de>.
Hi,

Thanks for the help. But I still have some problems.

I do not really understand the reason for the <project>-build module.
Do you use the module just for creating the assemblies?
I tried to invoke the assembly plugin from the top level directory.
The invokation should call all configured assemblies of the submodules.

Is this possible?

Thanks

Timo


On Nov 23, 2006, at 12:48 PM, Barrie Treloar wrote:

> On 11/23/06, Paolo Bacci <pa...@longadata.com> wrote:
>> Nabble archives don't open here, returns timeout everytime.
>> Does it have protection from brazilian ips? If so, a proxy would  
>> help.
>>
>> Barrie Treloar, could you send an example of your assembly  
>> descriptor?
>
> No Idea why Nabble is blocking you.
> The link you want is:
> http://www.nabble.com/forum/ViewPost.jtp? 
> post=5936062&framed=y&skin=177
> http://www.nabble.com/forum/ViewPost.jtp? 
> post=5954911&framed=y&skin=177
>
>
> I have cut-n-paste the email here:
>
> http://www.nabble.com/forum/ViewPost.jtp? 
> post=5936062&framed=y&skin=177
>
> My project layout is:
> ROOT/
> - pom.xml
> - module1
> - moduleN
> - <project>-build
>  - pom.xml
>
> In <project>-build/pom.xml I have:
>    <dependencies>
>        <dependency>
>            <groupId>my.group</groupId>
>            <artifactId>module1Artifact</artifactId>
>            <version>1.0-SNAPSHOT</version>
>            <type>zip</type>
>        </dependency>
>        <dependency>
>            <groupId>my.group</groupId>
>            <artifactId>module2Artifact</artifactId>
>            <version>1.0-SNAPSHOT</version>
>            <classifier>bin</classifier>
>            <type>zip</type>
>        </dependency>
>        <dependency>
>            <groupId>my.group</groupId>
>            <artifactId>module3Artifact</artifactId>
>            <version>1.0-SNAPSHOT</version>
>            <classifier>bin</classifier>
>            <type>zip</type>
>        </dependency>
>        <dependency>
>            <groupId>my.group</groupId>
>            <artifactId>module4Artifact</artifactId>
>            <version>1.0-SNAPSHOT</version>
>            <type>ear</type>
>        </dependency>
>    </dependencies>
>
> So my main build collects 4 artifacts:
> - a client side eclipse RCP (artifact1) as a zip
> - 2 standalone applications (artifact2, artifact3) as binary builds
> (these are the attached binary assemblies created when you install
> artifact2 and artifact3)
> - an ear file (artifact4)
>
> My assembly in <project>-build/src/main/assembly/bin.xml:
> <assembly>
>    <id>bin</id>
>    <formats>
>        <!-- There is a defect http://jira.codehaus.org/browse/ 
> MASSEMBLY-119
>         that means dir format will attempt to attach this format into
> the repository
>         and will cause the build to fail.
>        <format>dir</format>
>        -->
>        <format>zip</format>
>    </formats>
>    <includeBaseDirectory>true</includeBaseDirectory>
>    <dependencySets>
>        <dependencySet>
>          <unpack>false</unpack>
>          <outputFileNameMapping>
>            ${artifactId}-${baseVersion}.${extension}</ 
> outputFileNameMapping>
>          <excludes>
>            <!--
>            There is little documentation on this format.
>            It is of the form of  
> DefaultArtifact.getDependencyConflictId()
>            which is <groupId>:<artifactId>:<type>:<classifier>
>            or you can use the short form (hard coded into assembly) of
>            <groupId>:<artifactId>
>            This is a String equality match not a pattern match.
>
>            See Project Transitive Dependencies in site/ 
> dependencies.html
>            for easy cut and paste values to put in here
>            -->
>            <exclude>commons-beanutils:commons-beanutils</exclude>
>            <exclude>
>              commons-beanutils:commons-beanutils-bean-collections</ 
> exclude>
>            <exclude>commons-beanutils:commons-beanutils-core</exclude>
>            <exclude>commons-collections:commons-collections</exclude>
>            <exclude>commons-configuration:commons-configuration</ 
> exclude>
>            <exclude>commons-digester:commons-digester</exclude>
>            <exclude>commons-lang:commons-lang</exclude>
>            <exclude>commons-logging:commons-logging</exclude>
>            <exclude>easyconf:easyconf</exclude>
>            <exclude>log4j:log4j</exclude>
>            <exclude>weblogic:weblogic</exclude>
>            <exclude>xstream:xstream</exclude>
>          </excludes>
>        </dependencySet>
>    </dependencySets>
> </assembly>
>
> You need all those excludes because you dependency on the binary
> artifact also depends upon the jars which get included even though
> those same jars have already been included in the binary assembly.
>
> http://www.nabble.com/forum/ViewPost.jtp? 
> post=5954911&framed=y&skin=177
>
> Module 1 to Module N have assemblies like src/main/assembly/bin.xml
> (which is building a binary distribution for an artifact say
> my.group:mouldeA):
>
> I have:
>
> <assembly>
>  <id>bin</id>
>  <formats>
>    <format>dir</format>
>    <format>zip</format>
>  </formats>
>  <includeBaseDirectory>true</includeBaseDirectory>
>  <fileSets>
>    <fileSet>
>      <directory>src/main/config</directory>
>      <outputDirectory>config/</outputDirectory>
>      <includes>
>        <include>*</include>
>      </includes>
>    </fileSet>
>    <fileSet>
>      <directory>target</directory>
>      <outputDirectory></outputDirectory>
>      <includes>
>        <include>${artifactId}-${version}.jar</include>
>      </includes>
>    </fileSet>
>  </fileSets>
>  <files>
>    <file>
>      <source>src/main/scripts/start_debug.bat</source>
>      <filtered>false</filtered>
>    </file>
>    <file>
>      <source>src/main/scripts/start.bat</source>
>      <filtered>false</filtered>
>    </file>
>    <file>
>      <source>src/main/scripts/stop.bat</source>
>      <filtered>false</filtered>
>    </file>
>  </files>
>  <dependencySets>
>    <dependencySet>
>      <outputDirectory>lib</outputDirectory>
>      <unpack>false</unpack>
>      <outputFileNameMapping>
>        ${artifactId}-${baseVersion}.${extension}</ 
> outputFileNameMapping>
>    </dependencySet>
>  </dependencySets>
> </assembly>
>
>
> HTH
>
> ---------------------------------------------------------------------
> 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


Re: Assembly plugin for multi module project

Posted by Barrie Treloar <ba...@gmail.com>.
On 11/23/06, Paolo Bacci <pa...@longadata.com> wrote:
> Nabble archives don't open here, returns timeout everytime.
> Does it have protection from brazilian ips? If so, a proxy would help.
>
> Barrie Treloar, could you send an example of your assembly descriptor?

No Idea why Nabble is blocking you.
The link you want is:
http://www.nabble.com/forum/ViewPost.jtp?post=5936062&framed=y&skin=177
http://www.nabble.com/forum/ViewPost.jtp?post=5954911&framed=y&skin=177


I have cut-n-paste the email here:

http://www.nabble.com/forum/ViewPost.jtp?post=5936062&framed=y&skin=177

My project layout is:
ROOT/
- pom.xml
- module1
- moduleN
- <project>-build
  - pom.xml

In <project>-build/pom.xml I have:
    <dependencies>
        <dependency>
            <groupId>my.group</groupId>
            <artifactId>module1Artifact</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>my.group</groupId>
            <artifactId>module2Artifact</artifactId>
            <version>1.0-SNAPSHOT</version>
            <classifier>bin</classifier>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>my.group</groupId>
            <artifactId>module3Artifact</artifactId>
            <version>1.0-SNAPSHOT</version>
            <classifier>bin</classifier>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>my.group</groupId>
            <artifactId>module4Artifact</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>ear</type>
        </dependency>
    </dependencies>

So my main build collects 4 artifacts:
- a client side eclipse RCP (artifact1) as a zip
- 2 standalone applications (artifact2, artifact3) as binary builds
(these are the attached binary assemblies created when you install
artifact2 and artifact3)
- an ear file (artifact4)

My assembly in <project>-build/src/main/assembly/bin.xml:
<assembly>
    <id>bin</id>
    <formats>
        <!-- There is a defect http://jira.codehaus.org/browse/MASSEMBLY-119
         that means dir format will attempt to attach this format into
the repository
         and will cause the build to fail.
        <format>dir</format>
        -->
        <format>zip</format>
    </formats>
    <includeBaseDirectory>true</includeBaseDirectory>
    <dependencySets>
        <dependencySet>
          <unpack>false</unpack>
          <outputFileNameMapping>
            ${artifactId}-${baseVersion}.${extension}</outputFileNameMapping>
          <excludes>
            <!--
            There is little documentation on this format.
            It is of the form of DefaultArtifact.getDependencyConflictId()
            which is <groupId>:<artifactId>:<type>:<classifier>
            or you can use the short form (hard coded into assembly) of
            <groupId>:<artifactId>
            This is a String equality match not a pattern match.

            See Project Transitive Dependencies in site/dependencies.html
            for easy cut and paste values to put in here
            -->
            <exclude>commons-beanutils:commons-beanutils</exclude>
            <exclude>
              commons-beanutils:commons-beanutils-bean-collections</exclude>
            <exclude>commons-beanutils:commons-beanutils-core</exclude>
            <exclude>commons-collections:commons-collections</exclude>
            <exclude>commons-configuration:commons-configuration</exclude>
            <exclude>commons-digester:commons-digester</exclude>
            <exclude>commons-lang:commons-lang</exclude>
            <exclude>commons-logging:commons-logging</exclude>
            <exclude>easyconf:easyconf</exclude>
            <exclude>log4j:log4j</exclude>
            <exclude>weblogic:weblogic</exclude>
            <exclude>xstream:xstream</exclude>
          </excludes>
        </dependencySet>
    </dependencySets>
</assembly>

You need all those excludes because you dependency on the binary
artifact also depends upon the jars which get included even though
those same jars have already been included in the binary assembly.

http://www.nabble.com/forum/ViewPost.jtp?post=5954911&framed=y&skin=177

Module 1 to Module N have assemblies like src/main/assembly/bin.xml
(which is building a binary distribution for an artifact say
my.group:mouldeA):

I have:

<assembly>
  <id>bin</id>
  <formats>
    <format>dir</format>
    <format>zip</format>
  </formats>
  <includeBaseDirectory>true</includeBaseDirectory>
  <fileSets>
    <fileSet>
      <directory>src/main/config</directory>
      <outputDirectory>config/</outputDirectory>
      <includes>
        <include>*</include>
      </includes>
    </fileSet>
    <fileSet>
      <directory>target</directory>
      <outputDirectory></outputDirectory>
      <includes>
        <include>${artifactId}-${version}.jar</include>
      </includes>
    </fileSet>
  </fileSets>
  <files>
    <file>
      <source>src/main/scripts/start_debug.bat</source>
      <filtered>false</filtered>
    </file>
    <file>
      <source>src/main/scripts/start.bat</source>
      <filtered>false</filtered>
    </file>
    <file>
      <source>src/main/scripts/stop.bat</source>
      <filtered>false</filtered>
    </file>
  </files>
  <dependencySets>
    <dependencySet>
      <outputDirectory>lib</outputDirectory>
      <unpack>false</unpack>
      <outputFileNameMapping>
        ${artifactId}-${baseVersion}.${extension}</outputFileNameMapping>
    </dependencySet>
  </dependencySets>
</assembly>


HTH

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


Re: Assembly plugin for multi module project

Posted by Paolo Bacci <pa...@longadata.com>.
Nabble archives don't open here, returns timeout everytime.
Does it have protection from brazilian ips? If so, a proxy would help.

Barrie Treloar, could you send an example of your assembly descriptor?

Thx,
Paolo Bacci

On 11/23/06, Barrie Treloar <ba...@gmail.com> wrote:
>
> On 11/23/06, Timo Wolf <wo...@in.tum.de> wrote:
> > Hi,
> >
> > I have the same problem for some time and cannot find a solution.
> > I found lots of users including me have big problems with the
> > assembly plugin in multi module projects.
>
> Search the Nabble archives.
>
> I am happily using assembly in multi-module mode, however I use
> dependencySets not moduleSets.  If you search for something like
> assembly example baerrach you will find the emails (and other emails
> with answers similar to this pointing to the original threads)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Assembly plugin for multi module project

Posted by Barrie Treloar <ba...@gmail.com>.
On 11/23/06, Timo Wolf <wo...@in.tum.de> wrote:
> Hi,
>
> I have the same problem for some time and cannot find a solution.
> I found lots of users including me have big problems with the
> assembly plugin in multi module projects.

Search the Nabble archives.

I am happily using assembly in multi-module mode, however I use
dependencySets not moduleSets.  If you search for something like
assembly example baerrach you will find the emails (and other emails
with answers similar to this pointing to the original threads)

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


Re: Assembly plugin for multi module project

Posted by Timo Wolf <wo...@in.tum.de>.
Hi,

I have the same problem for some time and cannot find a solution.
I found lots of users including me have big problems with the
assembly plugin in multi module projects.

Please help if possible.

Timo


On Nov 22, 2006, at 8:53 PM, Paolo Bacci wrote:

> Hi,
>
> I need to make an assembly of my project to make tests on windows.  
> I read
> this manual
> http://maven.apache.org/plugins/maven-assembly-plugin/examples/ 
> multimodule/module-binary-inclusion-simple.html
> but i keep getting the same error message:
>
> [INFO]
>> --------------------------------------------------------------------- 
>> ---
>> [ERROR] BUILD ERROR
>> [INFO]
>> --------------------------------------------------------------------- 
>> ---
>> [INFO] Error creating assembly: You must set at least one file.
>>
>> [INFO]
>> --------------------------------------------------------------------- 
>> ---
>
>
> My project is set up as:
>
> Parent
> child1
> child2
> child3
>
> I can build the .jar with "mvn package" command, but when I try to  
> run mvn
> assembly:assembly, it returns me the error from above.
> I've tried using the default descriptor, but it creates an empty  
> file, so
> I've searched for an descriptor example and after that started  
> using this
> descriptor:
>
> <assembly>
>>   <id>bin</id>
>>     <formats>
>>         <format>tar.gz</format>
>>     </formats>
>>    <includeBaseDirectory>false</includeBaseDirectory>
>>      <moduleSets>
>>       <moduleSet>
>>        <includes>
>>         <include>com.longadata.scapintegration.api</include>
>>         <include>com.longadata.scapintegration.core</include>
>>         <include>com.longadata.scapintegration.model</include>
>>        </includes>
>>        <binaries>
>>
>> <outputDirectory>modules/scap-integration-branch</outputDirectory>
>>          <includeDependencies>true</includeDependencies>
>>          <unpack>false</unpack>
>>        </binaries>
>>       </moduleSet>
>>      </moduleSets>
>> </assembly>
>
>
> Both of them are not giving me the expected result.
> Does anybody has any clue about what could be possibly wrong?
>
> thx,
> Paolo Bacci.


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