Uploaded image for project: 'Maven Antrun Plugin'
  1. Maven Antrun Plugin
  2. MANTRUN-178

Ignore precedence of mvn command line over property defined in <properties> section



    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 3.0.0
    • Labels:
    • Environment:
      Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800)
      Java version: 1.6.0_22, vendor: Sun Microsystems Inc.
      OS name: "windows xp"
      arch: "x86"


      When (Maven) property is not defined in <properties> section in pom.xml and (System) property is given at mvn command line, then such property is picked up properly in Ant target.
      When (Maven) property is defined in <properties> section in pom.xml and (System) property is given with different value at mvn command line, such property value in Ant target is kept to one defined in the <properties> section, not one given at mvn command line; and this conflicts with how other Maven plugins treats such property value. The expectation is that it picks up the value given at the mvn command line.

      The antrun.zip attachment contains a sample Maven project. please try it run like:
      mvn -Dproptest_sysprop="defined" -Dproptest_Overwrite=true initialize

      It will demonstrate the issue like:
      [echo] *** mvn recognizes proptest_Overwrite property value as "true". ***
      [echo] *** Checking integrity over proptest_Overwrite property as case of overwriting hard-coded property value at mvn command line. ***
      [echo] Dump of proptest_Overwrite value by Ant's echoproperties tag:
      [echoproperties] proptest_Overwrite=false
      [echo] Dump of proptest_Overwrite value by Ant's echo tag:
      [echo] proptest_Overwrite = true
      [echo] proptest_Overwrite property value could keep integrity at Ant's equals condition tag: its value is recognized as "true".
      [INFO] ------------------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [ERROR] Target exception: java.lang.RuntimeException: proptest_Overwrite property value could not keep integrity in Ant's Project object: expected "true" but actually "false"


        1. antrun.zip
          3 kB

          Issue Links



              • Assignee:
                gboue Guillaume Boué
                arty Arata
              • Votes:
                3 Vote for this issue
                7 Start watching this issue


                • Created: