-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Windows 7 64 bit
groovy-plugin version 1.25
jenkins 1.594
groovy-version 2.3.4
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.
- depends on
-
JENKINS-23617 Cannot use spaces in groovy script parameters
-
- Resolved
-
-
JENKINS-24757 Allow spaces in script parameters
-
- Resolved
-
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.