对于此用例,使用该
library步骤在运行时动态加载它会更有意义。
在你的
firstPipe.groovy,你可以这样做:
final myoneLib = library('myOneLib') def execute(String zCmakeListsPath){ stage('some kind of stage 2') { echo "Hello from stage 1 with " + zCmakeListsPath echo "var attempt ${env.mySrcDir}" } stage('second stage'){ echo "and one from stage 2" echo "param was " + zCmakeListsPath echo "var attempt ${env.myBuildDir}" //call function from global lib myOneLib.deleteFile 'for 3rd party global library now' } } return this请参阅“ 使用共享库扩展” 文档中的“
动态加载库” 部分 __。



