How to call functions in one Jenkins Shared Library from another

拜拜、爱过 提交于 2019-12-05 17:45:38

In Jenkinsfile:

@Library(['libA', 'libB']) _

and you can call between them:

import org.myorg.PruebaA / import org.myorg.PruebaB

This depends on where the Libraries are are stored.

If they are under ./vars/ then you do not need to import them, as the Jenkinsfile has already imported all scripts via the @Library('sharedLibs') _. You would just call it, def a = LibraryB.functionA()

If it is under a traditional ./src/com/something/whatevas, then you would do a more traditional import com.something.whateva.Library at the top of the Library A

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