jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Assembly Plugin
  • MASSEMBLY-97

multiproject with assembly fails in mysterious ways

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Won't Fix
  • Affects Version/s: 2.1
  • Fix Version/s: 2.2-beta-1
  • Labels:
    None
  • Testcase included:
    yes

Description

The attached project has a (very simple) multiproject build.

If you edit the root pom.xml and comment out project2, then "mvn install" will execute correctly and build and assemble the jar files, and deploy them to the local repo.

If you have both project1 and project2, then something odd happens - it fails building the package for item1, but the error report is that there is a missing dependency for item2's package - which it hasn't built yet.

This means that 'root level' builds for us can't be executed from a clean system as they always fall over.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    bug.zip
    10/May/06 5:16 AM
    5 kB
    Nigel Magnay
    1. XML File
      bug/pom.xml 0.5 kB
    2. XML File
      bug/project1/item/pom.xml 0.5 kB
    3. XML File
      bug/project1/package/pom.xml 2 kB
    4. XML File
      bug/project1/package/.../assemble/main.xml 0.6 kB
    5. XML File
      bug/project1/pom.xml 0.6 kB
    6. XML File
      bug/project2/item/pom.xml 0.5 kB
    7. XML File
      bug/project2/package/pom.xml 2 kB
    8. XML File
      bug/project2/package/.../assemble/main.xml 0.6 kB
    9. XML File
      bug/project2/pom.xml 0.6 kB
    Download Zip
    Show
    Zip Archive
    bug.zip
    10/May/06 5:16 AM
    5 kB
    Nigel Magnay
  2. Hide
    Zip Archive
    bug-assembly-2.0.1.zip
    15/May/06 6:44 AM
    4 kB
    Sei Syvalta
    1. XML File
      bug/module1/pom.xml 1 kB
    2. XML File
      bug/module1/src/main/assembly/main.xml 0.6 kB
    3. XML File
      bug/module1/src/main/pom.xml 2 kB
    4. XML File
      bug/module2/pom.xml 0.7 kB
    5. XML File
      bug/module3/pom.xml 0.7 kB
    6. XML File
      bug/pom.xml 0.9 kB
    Download Zip
    Show
    Zip Archive
    bug-assembly-2.0.1.zip
    15/May/06 6:44 AM
    4 kB
    Sei Syvalta
  3. Hide
    Zip Archive
    bug-assembly-2.1-SNAPSHOT.zip
    15/May/06 6:45 AM
    4 kB
    Sei Syvalta
    1. XML File
      bug/module1/pom.xml 1 kB
    2. XML File
      bug/module1/src/main/assembly/main.xml 0.6 kB
    3. XML File
      bug/module1/src/main/pom.xml 2 kB
    4. XML File
      bug/module2/pom.xml 0.7 kB
    5. XML File
      bug/module3/pom.xml 0.7 kB
    6. XML File
      bug/pom.xml 0.9 kB
    Download Zip
    Show
    Zip Archive
    bug-assembly-2.1-SNAPSHOT.zip
    15/May/06 6:45 AM
    4 kB
    Sei Syvalta

Issue Links

is duplicated by

Bug - A problem which impairs or prevents the functions of the product. MASSEMBLY-102 'attached' goal bound to 'package' phase not working in a multiproject environment when having dependency between its modules

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Sei Syvalta added a comment - 15/May/06 6:43 AM

I'm seeing this too. It applies also to maven 2.0.4 with assembly plugin 2.0.1.

I have attached a simplified example project based on the one submitted by Nigel Magnay. It demonstrates the bug with 3 modules only.

The bug occurs when there are three modules in a reactor build (the simplest case):

  • the 1st module has assembly attached to package phase (assembly or attach goal)
  • the second module has dependency to module 1
  • the third module has dependency to module 2

In this case the build fails. If the dependency in module 3 is changed to module 1, everything works as expected. This might be caused by a bug in some other component (dependency management?) as it seems to affect also some other plugins.

I would really appreciate if someone would have time to take a look at this. Additionally, it would be really nice to have a release of the assembly-plugin, as the attached goal is really useful and using snapshot plugins is bit risky in a production build environment.

Show
Sei Syvalta added a comment - 15/May/06 6:43 AM I'm seeing this too. It applies also to maven 2.0.4 with assembly plugin 2.0.1. I have attached a simplified example project based on the one submitted by Nigel Magnay. It demonstrates the bug with 3 modules only. The bug occurs when there are three modules in a reactor build (the simplest case):
  • the 1st module has assembly attached to package phase (assembly or attach goal)
  • the second module has dependency to module 1
  • the third module has dependency to module 2
In this case the build fails. If the dependency in module 3 is changed to module 1, everything works as expected. This might be caused by a bug in some other component (dependency management?) as it seems to affect also some other plugins. I would really appreciate if someone would have time to take a look at this. Additionally, it would be really nice to have a release of the assembly-plugin, as the attached goal is really useful and using snapshot plugins is bit risky in a production build environment.
Hide
Permalink
Sei Syvalta added a comment - 15/May/06 6:44 AM

attached example project for assembly 2.0.1

Show
Sei Syvalta added a comment - 15/May/06 6:44 AM attached example project for assembly 2.0.1
Hide
Permalink
Sei Syvalta added a comment - 15/May/06 6:45 AM

attached example project for assembly 2.1-SNAPSHOT

Show
Sei Syvalta added a comment - 15/May/06 6:45 AM attached example project for assembly 2.1-SNAPSHOT
Hide
Permalink
Sei Syvalta added a comment - 16/May/06 4:16 AM

Still occurs with assembly 2.1final.

Show
Sei Syvalta added a comment - 16/May/06 4:16 AM Still occurs with assembly 2.1final.
Hide
Permalink
David Boden added a comment - 11/Jun/06 3:26 PM

The goals are fixed by removing the @aggregator annotation from the class documentation. For example, removing it from AssemblyMojo.java.

The aggregator annotation implies that the plugin is only able to build the aggregator pom in a multi-project build. This is not the case. The assembly plugin can run on sub-projects.

Show
David Boden added a comment - 11/Jun/06 3:26 PM The goals are fixed by removing the @aggregator annotation from the class documentation. For example, removing it from AssemblyMojo.java. The aggregator annotation implies that the plugin is only able to build the aggregator pom in a multi-project build. This is not the case. The assembly plugin can run on sub-projects.
Hide
Permalink
David Boden added a comment - 12/Jun/06 4:27 AM

I have worked around this by using "single" as the goal rather than "assembly". The "single" goal has been added as a workaround for this issue until the maven core can provide better multi-project support.

This works for me:

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifestFile>META-INF/MANIFEST.MF</manifestFile>
</archive>
<descriptors>
<descriptor>../SSBuild/bundle-assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>

Show
David Boden added a comment - 12/Jun/06 4:27 AM I have worked around this by using "single" as the goal rather than "assembly". The "single" goal has been added as a workaround for this issue until the maven core can provide better multi-project support. This works for me: <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <archive> <manifestFile>META-INF/MANIFEST.MF</manifestFile> </archive> <descriptors> <descriptor>../SSBuild/bundle-assembly.xml</descriptor> </descriptors> </configuration> </plugin>
Hide
Permalink
Sei Syvalta added a comment - 24/Oct/06 8:33 AM

There is no equivalent target for directory task. "directory-inline" is similar like "attached", which means that to completely workaround this bug would require yet another task "directory-single".

Show
Sei Syvalta added a comment - 24/Oct/06 8:33 AM There is no equivalent target for directory task. "directory-inline" is similar like "attached", which means that to completely workaround this bug would require yet another task "directory-single".
Hide
Permalink
John Casey added a comment - 27/Oct/06 12:34 AM

Use assembly:single or assembly:directory-single for this type of application. directory-single is added in 2.2-SNAPSHOT

Show
John Casey added a comment - 27/Oct/06 12:34 AM Use assembly:single or assembly:directory-single for this type of application. directory-single is added in 2.2-SNAPSHOT

People

  • Assignee:
    John Casey
    Reporter:
    Nigel Magnay
Vote (13)
Watch (9)

Dates

  • Created:
    10/May/06 5:16 AM
    Updated:
    28/Mar/07 12:04 PM
    Resolved:
    27/Oct/06 12:34 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.