How can I disable security checks for Jenkins pipeline builds

前端 未结 5 956
日久生厌
日久生厌 2020-12-19 00:51

I\'m running Jenkins in a local trusted environment where I\'m trying to run this pipeline. This Jenkinsfile is checked into git.

#!groovy
node(\'master\')          


        
5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-19 01:15

    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.

提交回复
热议问题