Assembly including binaries: Bug on a n depth hierarchy
-------------------------------------------------------

                 Key: MASSEMBLY-133
                 URL: http://jira.codehaus.org/browse/MASSEMBLY-133
             Project: Maven 2.x Assembly Plugin
          Issue Type: Bug
    Affects Versions: 2.1
         Environment: Maven 2.0.4
            Reporter: Alexis Midon
            Priority: Critical
         Attachments: AbstractAssemblyMojo.java

Considering the following complex but common pom hierarchy (sample) :
The syntax is packaging:pom:level.#

         pom:pom0.0
            /\
           /  \
          /    \
         /      \
        /        \
    jar:pom1.0   pom:pom1.1
                        /\
                       /  \
                      /    \
                     /      \
                    /        \
             jar:pom2.0      jar:pom2.1


I'd like to use the assembly plugin to gather all the output jars in a single 
directory.
(So every child/target/artifact.jar must copy to root/target/assembly/...)

To do so I execute the assemby:assembly goal with the following descriptor :

<assembly>
    <id>collect-alljars</id>
    <formats>
        <format>dir</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <moduleSets>
        <moduleSet>
            <binaries>
                <unpack>false</unpack>
            </binaries>
        </moduleSet>
    </moduleSets>
</assembly>

Unfortunately this always fails into an exception: "pom:pom1.1 does not have an 
artifact with a file. Please ensure the package phase (...)"

This use case highlights 2 problems I think:

   1. the assembly plugin does not support n depth hierarchy
      Actually pom:pom1.1 should be included in the module list but jar:pom2.0 
and jar:pom2.1 should be too!
   2. the <binaries/> tag must not throw an exception if there is no file, 
distonction on packaging type sounds necessary


To understand what's going on with bug #1, I decided to debug the plugin.
The problem occurs in AbstractAssemblyMojo.processModules (...) line 471
The getModulesFromReactor() method is invoked but with recurse set to false!

As a result when jar:pom2.0 is tested, the isProjectModule() method returns 
false, which is not correct (in our case).
May be 'recurse' could be a plugin parameter?

The patch is delimited by // PATCH BEGIN/END, modif on lines 470 and 514.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to