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

parameters with spaces dont work on windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: groovy-plugin
    • Labels:
      None
    • Environment:
      Windows 7 64 bit
      groovy-plugin version 1.25
      jenkins 1.594
      groovy-version 2.3.4
    • Similar Issues:

      Description

      I cant set script parameters and properties with spaces correctly.

      I have a step "Execute Groovy script" with the command:
      println System.getProperty("param")

      Double qoutes
      The script parameters: -Dparam="a b"
      The Properties: param="a b"

      Both print: null

      Single qoutes
      The script parameters: -Dparam='a b'
      prints: null

      The Properties: param='a b'
      prints: 'a b'
      The string contains the single qoutes

      My workaround is to use properties with single qoutes and remove them within the script.

        Attachments

          Issue Links

            Activity

            Hide
            pjdarton pjdarton added a comment -

            It's not merely "can't use spaces".
            The plugin calls groovy's batch files, which get very confused with complex arguments.
            e.g. They mess up * characters.

            The workaround I used was to do away with arguments entirely and to put the argument data within my groovy script code itself - you can trust the groovy script, you just can't trust the argument handling between the Jenkins job configuration data and the groovy script to pass things unmodified. Otherwise you can't pass in an argument string containing quotes or wildcards.

            Show
            pjdarton pjdarton added a comment - It's not merely "can't use spaces". The plugin calls groovy's batch files, which get very confused with complex arguments. e.g. They mess up * characters. The workaround I used was to do away with arguments entirely and to put the argument data within my groovy script code itself - you can trust the groovy script, you just can't trust the argument handling between the Jenkins job configuration data and the groovy script to pass things unmodified. Otherwise you can't pass in an argument string containing quotes or wildcards.

              People

              • Assignee:
                vjuranek vjuranek
                Reporter:
                stautz85 Sebastian
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: