我希望稍后在Config.groovy
中重复使用vars示例:
static.serverURL = "http://static.foo.com"
static.path = ""
bar.default.picUrl=static.serverURL+static.path+"/images/bar.png"
但这给了我一个
groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String)
将其更改为
bar.default.picUrl=""+static.serverURL+static.path+"/images/bar.png"
给了我
[:][:]/images/bar.png
使用
bar.default.picUrl=${static.serverURL}+${static.path}+"/images/bar.png"
给了我
nullnull/images/bar.png
答案 0 :(得分:1)
你有没有尝试过:
bar.default.picUrl="${static.serverURL}${static.path}"/images/bar.png