Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-3443

boolean values in the POM specified as expressions are not interpolated, result in value == false

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.8, 2.0.9, 3.0-alpha-1
    • None
    • POM
    • None

    Description

      The problem is the ModelReader generated by Modello uses something akin to Boolean.valueOf( element.getValue() ) to set boolean model values. If the value in XML is actually an expression, it is resolved to false and never interpolated.

      To correct this, we should consider revising Modelllo's generated reader architecture to use a two-stage approach:

      1. Construct a raw structure of String: String and String: Collection associations (basically something like a perlish hash, IIRC)
      2. Pass an arbitrary number of transformers over the raw structure to interpolate it (this includes path translation, etc. and should include a notion of transformation context to allow transformations to collaborate)
      3. Construct the Model instance based on the transformed raw structure.

      This will incur a little extra transient overhead for model construction, but its effects should be mitigated through the caching strategies we employ for models and projects.

      Attachments

        1. interpolate-boolean-expression.zip
          2 kB
          John Dennis Casey

        Issue Links

          Activity

            People

              brett Brett Porter
              jdcasey John Dennis Casey
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: