Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1
    • Labels:
      None

      Description

      The propoerties placed not alone inside quotes are not correctly interpreted. For example :
      <property name="myProp" value="OK" />
      <echo message="alone in quote :"/>
      <echo message="$

      {myProp}"/>
      <echo>not alone in text ${myProp}

      .</echo>
      <echo message="not alone in quote $

      {myProp}

      ."></echo>
      <fail unless="myProp"/>

      Succeed and print :
      [echo] alone in quote :
      [echo] OK
      [echo] not alone in text OK.
      [echo] not alone in quote null.

      While executed directly into ant prints :
      [echo] alone in quote :
      [echo] OK
      [echo] not alone in text OK.
      [echo] not alone in quote OK.

      You can find in attachment the pom.xml and the ant.xml I used.

      1. pom.xml
        1 kB
        Gilles Scokart
      2. MANTRUN-36.patch
        9 kB
        Gilles Scokart
      3. MANTRUN-36.patch
        8 kB
        Carlos Sanchez
      4. ant.xml
        0.3 kB
        Gilles Scokart

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          4d 6h 9m 1 Carlos Sanchez 01/Jan/06 14:32
          Mark Thomas made changes -
          Workflow jira [ 12953671 ] Default workflow, editable Closed status [ 12990806 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 22:13:33 UTC 2015 [ 1428272013336 ]
          Mark Thomas made changes -
          Workflow jira [ 12716336 ] Default workflow, editable Closed status [ 12759905 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 09:04:27 UTC 2015 [ 1428224667361 ]
          Brett Porter made changes -
          Workflow Maven [ 45141 ] Maven New [ 51562 ]
          Carlos Sanchez made changes -
          Fix Version/s 1.1 [ 12204 ]
          Assignee Carlos Sanchez [ carlos ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Hide
          Carlos Sanchez added a comment -

          Applied patch but keeping backwards compatibility. It could be a better implementation, but this works for all it tests.

          Show
          Carlos Sanchez added a comment - Applied patch but keeping backwards compatibility. It could be a better implementation, but this works for all it tests.
          Hide
          Carlos Sanchez added a comment -

          test4 in plugin sources covers this issue

          Show
          Carlos Sanchez added a comment - test4 in plugin sources covers this issue
          Carlos Sanchez made changes -
          Affects Version/s 1.1 [ 12204 ]
          Carlos Sanchez made changes -
          Attachment MANTRUN-36.patch [ 18368 ]
          Hide
          Carlos Sanchez added a comment -

          Imprved patch against current trunk

          Show
          Carlos Sanchez added a comment - Imprved patch against current trunk
          Carlos Sanchez made changes -
          Link This issue is duplicated by MANTRUN-29 [ MANTRUN-29 ]
          Gilles Scokart made changes -
          Field Original Value New Value
          Attachment MANTRUN-36.patch [ 18341 ]
          Hide
          Gilles Scokart added a comment -

          The attached patch should fix the bug.

          I'm not really happy with the solution used to pass the ExpressionEvaluator to the mojo, but I didn't find better. Indeed, as far as I have seen, the ExpressionEvaluator can neither be accessed as a component, neither as a maven property.

          Show
          Gilles Scokart added a comment - The attached patch should fix the bug. I'm not really happy with the solution used to pass the ExpressionEvaluator to the mojo, but I didn't find better. Indeed, as far as I have seen, the ExpressionEvaluator can neither be accessed as a component, neither as a maven property.
          Hide
          Gilles Scokart added a comment -

          In have found in the reason in the code.

          When a property $

          {...} is placed into an XML text, the value is not processed by the PluginParameterExpressionEvaluator.
          The text is thus given as is to ant, that forward it to the AntPropertyHelper provided by the antrun mojo. It works as expected.

          When a property ${...}

          is placed alone in an attribute, the PluginParameterExpressionEvaluator evaluate it to null, the AntTargetConverter of
          the antrun plugin detect this null, and forward the original ${} to ant. It works as expected.

          When a property $

          {...}

          is placed with some text into an attribute (for example "a text $

          {x}

          "), the PluginParameterExpressionEvaluator evaluate it to a string
          containing "a text null", the AntTargetConverter of the antrun plugin forward this text to ant that doesn't detect a property. It is the bu I have found.

          The solution is to not use the PluginParameterExpressionEvaluator before, but only after ant property processing (into the AntPropertyHelper).

          Show
          Gilles Scokart added a comment - In have found in the reason in the code. When a property $ {...} is placed into an XML text, the value is not processed by the PluginParameterExpressionEvaluator. The text is thus given as is to ant, that forward it to the AntPropertyHelper provided by the antrun mojo. It works as expected. When a property ${...} is placed alone in an attribute, the PluginParameterExpressionEvaluator evaluate it to null, the AntTargetConverter of the antrun plugin detect this null, and forward the original ${} to ant. It works as expected. When a property $ {...} is placed with some text into an attribute (for example "a text $ {x} "), the PluginParameterExpressionEvaluator evaluate it to a string containing "a text null", the AntTargetConverter of the antrun plugin forward this text to ant that doesn't detect a property. It is the bu I have found. The solution is to not use the PluginParameterExpressionEvaluator before, but only after ant property processing (into the AntPropertyHelper).
          Gilles Scokart created issue -

            People

            • Assignee:
              Carlos Sanchez
              Reporter:
              Gilles Scokart
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development