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

DependencySet elements appear not to be able to target the same outputDirectory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.1
    • 2.5.2
    • dependencySet
    • None
    • Linux, Sun 64-bit JDK 1.6.0_24

    Description

      Where an assembly descriptor uses two dependencySet elements, both of which have the same outputDirectory value, only the first is honoured and the second is ignored.

      In the attached ZIP are some test/POC files which demonstrate this issue. Project1 contains a .property file in

      src/main/resources

      and some start/stop scripts at

      src/main/resources/bin

      Project2 has a runtime dependency on Project1 and attempts to unpack both the scripts and the properties files to the same output-directory, specifying execute permissions for the start/stop scripts. However, only the first dependencySet is unpacked; to verify this behaviour, follow these steps:

      1) Unzip the map-jira-2.zip file to the filesystem.
      2) From the maven-assembly-jira2 directory, execute the mvn package command.
      3) Verify that in project2/target/project2-0.0.1-SNAPSHOT-deployable.zip the contents omits the start/stop scripts:

      $ unzip -l project2/target/project2-0.0.1-SNAPSHOT-deployable.zip
      Archive:  project2/target/project2-0.0.1-SNAPSHOT-deployable.zip
        Length     Date   Time    Name
              0  11-30-11 10:59   project2-0.0.1-SNAPSHOT/
              0  11-30-11 10:59   project2-0.0.1-SNAPSHOT/empty.properties
              0                   2 files
      

      4) Edit the descriptor project2/src/main/assembly/assembly.xml and move the second dependencySet element above the first.
      5) Execute mvn package from the maven-assembly-jira2 directory.
      6) Verify that the ZIP in project2 now omits the empty.properties file but does now contain the start/stop scripts:

      $ unzip -l project2/target/project2-0.0.1-SNAPSHOT-deployable.zip
      Archive:  project2/target/project2-0.0.1-SNAPSHOT-deployable.zip
        Length     Date   Time    Name
              0  11-30-11 11:02   project2-0.0.1-SNAPSHOT/
              0  11-30-11 11:02   project2-0.0.1-SNAPSHOT/bin/
              0  11-30-11 10:59   project2-0.0.1-SNAPSHOT/bin/start.sh
              0  11-30-11 10:59   project2-0.0.1-SNAPSHOT/bin/stop.sh
              0                   4 files
      

      Expected behavour would be for all files to be copied to their target locations with correct file-permissions.

      Attachments

        1. map-jira-2.zip
          3 kB
          Michael

        Issue Links

          Activity

            People

              krosenvold Kristian Rosenvold
              michaelg Michael
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: