It would be great to have the option to inject steps in the shared library using an annotation.

      That way, we can do this

      class Utilities implements Serializable { 
      
        @PipeLineSteps 
        def steps
      
        def mvn(args) { 
          steps.sh "${steps.tool 'Maven'}/bin/mvn -o ${args}" 
        } 
      }
      

      instead of having to inject directly "this" to the constructor.

          [JENKINS-46920] Allow to inject steps using an annotation

          Andrew Bayer added a comment -

          Intriguing idea. Gotta figure out how to make sure we inject the right instance, but yeah, worth considering.

          Andrew Bayer added a comment - Intriguing idea. Gotta figure out how to make sure we inject the right instance, but yeah, worth considering.

            Unassigned Unassigned
            dariver DarĂ­o Villadiego
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: