jenkins-pipeline - 詹金斯管道常规的奇怪行为
问题描述
我有一个 groovy 管道脚本:
stage("Test") {
str="[\"asd1\", \"asd2\"]"
def tagNames = str.tokenize(',[]').collect { it as String }
echo "${tagNames.getClass()}"
echo "${tagNames.size}"
}
但是在输出中我看到错误“找不到这样的字段:字段 java.lang.String 大小”:
[Pipeline] stage
[Pipeline] { (Test)
[Pipeline] echo
class java.util.ArrayList
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
No such field found: field java.lang.String size. Administrators can decide whether to approve or reject this signature.
[Pipeline] End of Pipeline
我做错了什么?
编辑:我有“没有待处理的签名批准”。
解决方案
使用
size()
代替
size
成功了。
推荐阅读
- firebird - 将 fbk (Firebird) 转换为 CSV
- flutter - 在运行颤振代码时需要帮助来解决此问题
- javascript - 有没有办法给 raycaster three.js 一个偏移量?
- ruby-on-rails - 使用 Ruby on Rails Devise Gem 使用用户名注册
- bash - 在多个主机上使用 Bash Shell 脚本进行 SSH 身份验证验证
- android - Qt c++应用程序在android tv上自动启动
- python - 当列表项出现并在字符串中匹配时创建嵌套字典
- android - Agora.io 音频正常但视频不传输
- flutter - 在 BottomNavigationBar 选项卡之间传递 StreamBuilder => 错误状态:Stream 已被监听
- relational-algebra - 这种自然连接操作是否正确使用?(关系代数)