How to dynamically add all methods of a class into another class
问题 I have a global shared library on Jenkins implicitly loaded on all pipelines, then my Jenkinsfile is like that: new com.company.Pipeline()() And then the shared library has on directory src/com/company some files, below the Pipeline.groovy class: package com.company import static Utils.* def call() { // some stuff here... } The problem is, this way I have to static declare all methods, thus I lose the context and cannot access jenkins' methods easly without the Pipeline class' instance. As