How can I disable security checks for Jenkins pipeline builds

早过忘川 提交于 2019-11-29 09:51:52

Currently it is not possible. There is an open ticket for this problem https://issues.jenkins-ci.org/browse/JENKINS-28178

Try the following jenkins plugin: https://wiki.jenkins-ci.org/display/JENKINS/Permissive+Script+Security+Plugin It disables the sandbox. Works for me.

You can solve the problem by following steps:

  1. install Permissive Script Security plugin (version 0.3 or newer)
  2. add permissive-script-security.enabled command line parameter to Jenkins master with value:

    • true if you want to disable the need to approve scripts, but potentially dangerous signatures will be logged:

      -Dpermissive-script-security.enabled=true
      
    • no_security if you want to disable the need to approve scripts and disable also logging of the potentially dangerous signatures:

      -Dpermissive-script-security.enabled=no_security
      

As answered above: in the newer Jenkins versions Script Security has been tightened. However for the specific use case of reading a version from Maven's pom.xml one could use readMavenPom from the Pipeline Utility Steps Plugin:

pom = readMavenPom file: 'pom.xml'
pom.version

With some other solutions in this StackOverflow question as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!