0
我想要獲得所有匹配過濾器的文件。這裏是我的代碼:Jenkins groovy安全問題
import static groovy.io.FileType.FILES
node {
try{
stage('get files')
new File('.').eachFileRecurse(FILES) {
if(it.name.endsWith('.nuspec')) {
echo it.Name
}
}
}catch(err) {
echo 'Err: Incremental Build failed with Error: ' + err.toString()
}finally {
}
我得到以下錯誤:
Err: Incremental Build failed with Error: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new java.io.File java.lang.String
我檢查沒有掛起的腳本審批。 我找不到任何選項來禁用沙箱。
當我在腳本控制檯中嘗試它時,腳本運行良好。 如何讓腳本在我的構建中運行? 謝謝!