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

assembly descriptor doesn't seem to property substitute properties

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2-beta-2
    • Fix Version/s: 2.2-beta-3
    • Component/s: None
    • Labels:
      None

      Description

      For the following assembly.xml:

      <assembly>
          <formats>
              <format>tar.gz</format>
          </formats>
          <includeBaseDirectory>false</includeBaseDirectory>
          <fileSets>
              <fileSet>
                  <directory>src/main/resources/appcontent</directory>
                  <outputDirectory>${build.environment}/${build.view}/appcontent</outputDirectory>
                  <includes>
                      <include>**</include>
                  </includes>
              </fileSet>
          </fileSets>
      </assembly>

      ${build.environment} and ${build.view} are declared as <properties> in parent POM. They retain their 'default' value and cannot be overridden from the command line using the -D (-Dbuild.environment=UAT) syntax.

      The intent of the properties is to build the tar.gz file with different paths based on the two variables.

      1. massembly-331-test.txt
        14 kB
        Petar Tahchiev
      2. massembly-331-source.txt
        9 kB
        Petar Tahchiev

        Issue Links

          Activity

          Hide
          hboutemy Hervé Boutemy added a comment -
          Show
          hboutemy Hervé Boutemy added a comment - r694529
          Hide
          jdcasey John Casey added a comment -

          applied with minor modifications. Thanks.

          Show
          jdcasey John Casey added a comment - applied with minor modifications. Thanks.
          Hide
          paranoiabla Petar Tahchiev added a comment -

          ... and here is the patch for the test-cases.

          Show
          paranoiabla Petar Tahchiev added a comment - ... and here is the patch for the test-cases.
          Hide
          paranoiabla Petar Tahchiev added a comment -

          Here is the patch for the source files.

          Show
          paranoiabla Petar Tahchiev added a comment - Here is the patch for the source files.
          Hide
          paranoiabla Petar Tahchiev added a comment -

          Hi Jon,

          you are right - the command line should override the pom.xml properties, and, indeeed, this is a bug.
          The point is that pre-(maven 2.0.9) the -D properties were system properties and now in maven 2.0.9 they are session execution properties.
          I have created a patch for this issue. It involves changing 6 classes:
          -AssemblyFormatUtils.java
          -ModuleSetAssemblyPhase.java
          -AssemblerConfigurationSource.java
          -AddArtifactTask.java
          -AddDependencySetsTask.java
          -AbstractAssemblyMojo.java

          The bad side of this patch is that it changes the signatures of several public methods.
          It also breaks several of the test-cases.
          I have also created a patch to repair the test-cases, so that they function as before.

          Cheers, Petar.

          Show
          paranoiabla Petar Tahchiev added a comment - Hi Jon, you are right - the command line should override the pom.xml properties, and, indeeed, this is a bug. The point is that pre-(maven 2.0.9) the -D properties were system properties and now in maven 2.0.9 they are session execution properties. I have created a patch for this issue. It involves changing 6 classes: -AssemblyFormatUtils.java -ModuleSetAssemblyPhase.java -AssemblerConfigurationSource.java -AddArtifactTask.java -AddDependencySetsTask.java -AbstractAssemblyMojo.java The bad side of this patch is that it changes the signatures of several public methods. It also breaks several of the test-cases. I have also created a patch to repair the test-cases, so that they function as before. Cheers, Petar.

            People

            • Assignee:
              jdcasey John Casey
              Reporter:
              jonnio Jon Osborn
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development