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

Cannot use spaces in groovy script parameters

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: groovy-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      The issue is caused by oversimplified parameters parsing implementation in this class: https://github.com/jenkinsci/groovy-plugin/blob/master/src/main/java/hudson/plugins/groovy/Groovy.java

              //Add groovy parameters
              if(parameters != null) {
                  StringTokenizer tokens = new StringTokenizer(parameters);
                  while(tokens.hasMoreTokens()) {
                      list.add(Util.replaceMacro(tokens.nextToken(),vr));
                  }
              }
      

      I would suggest to switch to org.apache.commons.exec.CommandLine.parse(..) method from Apache commons-exec.
      Not ideal, I know, but probably the best possible option if parsing command-line is inevitable.

      Is anyone interested in the patch? It would be very straightforward.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vjuranek vjuranek
                Reporter:
                enterit enterit
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: