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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7
    • 3.0.0
    • None
    • 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"

    Description

      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] 
      	 [echo] Dump of proptest_Overwrite value by Ant's echoproperties tag:
      	 ...
      [echoproperties] proptest_Overwrite=false
      	 [echo] 
      	 [echo] Dump of proptest_Overwrite value by Ant's echo tag:
      	 [echo] proptest_Overwrite = true
      	 [echo] 
      	 [echo] proptest_Overwrite property value could keep integrity at Ant's equals condition tag: its value is recognized as "true".
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [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"
      

      Attachments

        1. antrun.zip
          3 kB

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: