Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-33712

Empty parameterized build properties not quoted when passed to ant

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: ant-plugin, core
    • Labels:
    • Environment:
      Jenkins 1.654 ; Jenkins 2.0 ; Jenkins 2.1
      Ant Plugin 1.2
      Windows 7 x86_64 (master and slave)
      Apache Ant 1.9.6
    • Similar Issues:

      Description

      I have a parameterized build job that defines multiple string parameters. The main build step in that job is "Invoke Ant".

      Even though I do not define any "Properties" under "Invoke Ant", all of my job parameters are being passed to ant using "-D<Name>=<Value>". That is fine, except when one of my string parameters is blank. In that case Jenkins passes ant "-D<Name>=", which causes ant to barf.

      If a job parameter is blank then either it should not be passed to ant, or (probably better) a quoted empty string ("") should be passed to ant.

      Attached are a trivial ant build.xml and Jenkins config.xml that demonstrate the problem.

      Here is a sample Console Output:

      Building remotely on iqautobuild14 in workspace F:\Jenkins\workspace\AntJobWithProperty
      [AntJobWithProperty] $ cmd.exe /C "F:\Jenkins\tools\hudson.tasks.Ant_AntInstallation\Ant_from_Apache_\bin\ant.bat -DMY_VAR= && exit %%ERRORLEVEL%%"
      Missing value for property MY_VAR
      Build step 'Invoke Ant' marked build as failure
      Finished: FAILURE

      Note that this issue appears to be the same as JENKINS-5157 and JENKINS-7204 (among others), but those issues are supposedly fixed already. Either there is a subtle difference here that I do not understand, or Jenkins has suffered a regression.

        Attachments

        1. build.xml
          0.1 kB
        2. config.xml
          1 kB

          Issue Links

            Activity

            kcurrier Keith Currier created issue -
            benapgar Ben Apgar made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-33727 [ JENKINS-33727 ]
            escoem Emilio Escobar made changes -
            Assignee Emilio Escobar [ escoem ]
            escoem Emilio Escobar made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            danielbeck Daniel Beck made changes -
            Comment [ [~escoem] FYI another one. ]
            danielbeck Daniel Beck made changes -
            Labels regression
            belpk K P made changes -
            Priority Major [ 3 ] Blocker [ 1 ]
            escoem Emilio Escobar made changes -
            Link This issue depends on JENKINS-34308 [ JENKINS-34308 ]
            escoem Emilio Escobar made changes -
            Remote Link This issue links to "PR (Web Link)" [ 14214 ]
            escoem Emilio Escobar made changes -
            Link This issue depends on JENKINS-34308 [ JENKINS-34308 ]
            belpk K P made changes -
            Environment Jenkins 1.654
            Ant Plugin 1.2
            Windows 7 x86_64 (master and slave)
            Apache Ant 1.9.6
            Jenkins 1.654 ; Jenkins 2.0 ; Jenkins 2.1
            Ant Plugin 1.2
            Windows 7 x86_64 (master and slave)
            Apache Ant 1.9.6
            benapgar Ben Apgar made changes -
            Link This issue is related to JENKINS-7204 [ JENKINS-7204 ]
            benapgar Ben Apgar made changes -
            Link This issue is duplicated by JENKINS-34325 [ JENKINS-34325 ]
            escoem Emilio Escobar made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 169681 ] JNJira + In-Review [ 198659 ]

              People

              • Assignee:
                escoem Emilio Escobar
                Reporter:
                kcurrier Keith Currier
              • Votes:
                8 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: