Uploaded image for project: 'Maven Assembly Plugin'
  1. Maven Assembly Plugin
  2. MASSEMBLY-102

'attached' goal bound to 'package' phase not working in a multiproject environment when having dependency between its modules

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1
    • 2.2-beta-1
    • None
    • None
    • Linux (Fedora Core 4)

    Description

      I've noticed the assembly plugin does not work by binding the 'attached' goal to the 'package' phase in a multiproject environment when its modules depend on each other and the local repository is empty.
      To reproduce this issue, please consider the following scenario where M is a multiproject that contains modules A, B, C, D and E (see attached file for the entire project).

      + M

      • A
      • B (depends on A) (uses assembly plugin by binding 'attached' goal to 'package' phase)
      • C (depends on B)
      • D (depends on A)
      • E (depends on D)

      When running 'mvn install' in the project 'M' for the first time, the buid process fails saying that one required artifact is missing (see error below). And it turns out to be D.jar.
      #####################################################################################
      ...
      [INFO] [jar:jar]
      [INFO] Building jar: /l/disk0/devel/assembly/B/target/B-1.1.jar
      Downloading: http://kraz.cpqd.com.br/internal/release/repository/com/mycompany/assembly/D/1.1/D-1.1.jar
      [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Failed to resolve artifact.

      Missing:
      ----------
      1) com.mycompany.assembly:jar:1.1

      Try downloading the file manually from the project website.

      Then, install it using the command:
      mvn install:install-file -DgroupId=com.mycompany.assembly -DartifactId=D \
      -Dversion=1.1 -Dpackaging=jar -Dfile=/path/to/file

      Path to dependency:
      1) com.mycompany.assembly:E:jar:1.1
      2) com.mycompany.assembly:jar:1.1

      ----------
      1 required artifact is missing.

      for artifact:
      com.mycompany.assembly:E:jar:1.1

      from the specified remote repositories:
      central (http://repo1.maven.org/maven2)
      #####################################################################################

      It looks like module B triggers the compilation of all modules and when it does that, it happens that E is being compiling but its dependency (D) is not in the local repository yet.
      Please remember to remove the 'com/mycompany/assembly' directory from local repository before running 'mvn install'. Otherwise you won't be able to reproduce the problem.

      Thanks,
      Dário

      Attachments

        1. project_M.tar.gz
          12 kB
          Dário Oliveros

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              oliveros Dário Oliveros
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: