Maven
  1. Maven
  2. MNG-3057

properties not expanded in generated POMs when building A/B/C nested projects

    Details

    • Number of attachments :
      7

      Description

      Using Maven version: 2.0.8-SNAPSHOT, svn r547427.

      I checked out and built 2.0.8 because I was interested in Jason van Zyl's patch for MNG-2619- "building from the middle pom of a (parent,child,grandchild) heirarchy fails". The fix works for the most part, but there still seems to be a problem with the poms that get generated during the install goal. The poms that get installed into .m2/repository do not have properties interpolated. If I run maven like:

      $ mvn install -Dglobal-version=1.0.0

      I get poms with the string "$

      {global-version}

      " embedded in the resulting poms rather than what I specify on the command line (or in settings.xml). The build works properly aside from this, and if I do "mvn help:effective-pom" the properties are correctly interpolated.

      I've attached a tarfile with an example A/B/C build structure that exhibits this behavior, as well as the generated poms.

      Many thanks for your attention.

      1. example.tar.gz
        6 kB
        George Armhold
      2. generated-poms.tar.gz
        2 kB
        George Armhold
      3. InstallMojo.java.patch
        4 kB
        Henrik Brautaset Aronsen
      4. InstallMojo.java.patch
        3 kB
        Henrik Brautaset Aronsen
      5. InstallMojo.quoteReplacement.patch
        0.6 kB
        Henrik Brautaset Aronsen
      6. maven-install-parent.patch
        8 kB
        Henrik Brautaset Aronsen

        Issue Links

          Activity

          Hide
          Benjamin Bentmann added a comment -

          John, the removal of the license header was a regression of MNG-2820 for which I just added a (disabled) IT.

          Show
          Benjamin Bentmann added a comment - John, the removal of the license header was a regression of MNG-2820 for which I just added a (disabled) IT.
          Hide
          John Casey added a comment -

          Thanks, Benjamin, that saved me some time.

          Show
          John Casey added a comment - Thanks, Benjamin, that saved me some time.
          Hide
          John Casey added a comment -

          Added new interpolation strategy that uses raw contents of the POM XML file, and interpolates it from that string. This is a two-stage process, where the first stage interpolator isolates the version elements and hands the value off to the second-stage interpolator to actually resolve any expressions. Then, the result is re-inserted into the XML.

          Also, adjusted the handling for artifacts with type == pom during install/deploy, such that the accompanying file is forcibly set to the artifact's file, to work around MCOMPILER-94. Attachments should be handled separately, since they have their own Artifact instance. I've modified the integration test for MNG-3057 to inject the configuration from MCOMPILER-94 just to be sure it works.

          Show
          John Casey added a comment - Added new interpolation strategy that uses raw contents of the POM XML file, and interpolates it from that string. This is a two-stage process, where the first stage interpolator isolates the version elements and hands the value off to the second-stage interpolator to actually resolve any expressions. Then, the result is re-inserted into the XML. Also, adjusted the handling for artifacts with type == pom during install/deploy, such that the accompanying file is forcibly set to the artifact's file, to work around MCOMPILER-94 . Attachments should be handled separately, since they have their own Artifact instance. I've modified the integration test for MNG-3057 to inject the configuration from MCOMPILER-94 just to be sure it works.
          Hide
          Henrik Brautaset Aronsen added a comment -

          This issue is still not fixed in 2.1.0.

          Steps to reproduce:

          The project layout is this:

          first--+--second----third
                 |
                 +--fourth
          

          "third" has "second" as parent version, and "second"/"fourth" has "first" as parent version. They all use a common applicationVersion property, which is set in "first". "fourth" has a dependency on "third", which resolves OK, but it fails to resolve the transitive dependency to "second":

          [INFO] Failed to resolve artifact.
          
          GroupId: me
          ArtifactId: second
          Version: ${applicationVersion}
          
          Reason: Unable to download the artifact from any repository
          
            me:second:pom:${applicationVersion}
          
          Show
          Henrik Brautaset Aronsen added a comment - This issue is still not fixed in 2.1.0. Steps to reproduce: download and unzip maven-dependency-problem.zip cd first mvn clean install cd fourth mvn clean install (which fails) The project layout is this: first--+--second----third | +--fourth "third" has "second" as parent version, and "second"/"fourth" has "first" as parent version. They all use a common applicationVersion property, which is set in "first". "fourth" has a dependency on "third", which resolves OK, but it fails to resolve the transitive dependency to "second": [INFO] Failed to resolve artifact. GroupId: me ArtifactId: second Version: ${applicationVersion} Reason: Unable to download the artifact from any repository me:second:pom:${applicationVersion}
          Hide
          Benjamin Bentmann added a comment -

          The code that was introduced for this fix was removed from Maven 2.2+ due to reasons outlined in MNG-4223.

          Show
          Benjamin Bentmann added a comment - The code that was introduced for this fix was removed from Maven 2.2+ due to reasons outlined in MNG-4223 .

            People

            • Assignee:
              John Casey
              Reporter:
              George Armhold
            • Votes:
              9 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: