Hi,
In the build.groovy script, the --propOverwrites / -po parameter allows you to override or replace properties declared in the server or application configuration files.
This parameter accepts a comma-separated list of values in the form key1=value1,key2=value2,...,keyI=valueI.
But what if the value already contains commas?
Example: How to overload the applicationSrcDirs property with multiple folders?
There is no escape mechanism provided in the build.conf script.
// populate property overwrites from argument list
if (opts.po) props.propOverwrites = opts.po
if (props.propOverwrites) {
String[] propOverwrites = props.propOverwrites.split(',')
propOverwrites.each { buildPropertyOverwrite ->
(key, value) = buildPropertyOverwrite.tokenize('=')
if (key && value) {
if (opts.v) println "** Overwriting build property ${key} from cli argument --propOverwrite with value ${value}"
props.put(key, value)
}
else {
println "*! Overwriting build property from cli argument --propOverwrite failed due a null value ( key: $key , value :$v
}
}
}
Thanks.
Hi,
In the build.groovy script, the
--propOverwrites/-poparameter allows you to override or replace properties declared in the server or application configuration files.This parameter accepts a comma-separated list of values in the form
key1=value1,key2=value2,...,keyI=valueI.But what if the value already contains commas?
Example: How to overload the
applicationSrcDirsproperty with multiple folders?There is no escape mechanism provided in the build.conf script.
Thanks.