How Bamboo processes task arguments and passes them to OS shell
Parsing arguments
When executing different Tasks, Bamboo attempts to tokenize value entered in Arguments field. The general rules are:
- white characters are argument separators,
- single and double quotes are used to preserve white characters in arguments.
This particular string
clean install -DpartiallyQuotedArgument1="Partially Quoted Argument" 'Fully Quoted Argument'
would be tokenized as
clean
install
-DpartiallyQuotedArgument1="Partially Quoted Argument"
'Fully Quoted Argument'
Each line here represents a single argument that will be passed to shell.
Passing arguments to shell
Bamboo generally doesn't modify tokenized arguments before passing them to shell with one exception:
- on non-Windows OS arguments that are fully enclosed in single or double quotes will be stripped from those quotes.
This particular string
clean install -DpartiallyQuotedArgument1="Partially Quoted Argument" 'Fully Quoted Argument'
would be passed to Windows shell as
clean
install
-DpartiallyQuotedArgument1="Partially Quoted Argument"
'Fully Quoted Argument'
but to Unix shell as
clean
install
-DpartiallyQuotedArgument1="Partially Quoted Argument"
Fully Quoted Argument
FAQ
I want to pass double quotes with my argument to Unix shell.
Try this
'"Only external quotes will be stripped and double quotes will be preserved when passing this to Unix shell"'
My Maven Task doesn't work when I specify multiple targets in argument field
Make sure you haven't quoted the whole contents of Arguments field:
"clean install"
You should simply delete quotes
clean install
最終更新日: 2021 年 12 月 15 日
Powered by Confluence and Scroll Viewport.