title: How to override a Jenkinsfile library function locally?
body: <p>I have a standardized declarative Jenkinsfile used in many projects.  I have moved the entire pipeline into a library, so my Jenkinsfile looks like this:</p>
  
  <pre><code>@Library('default_jenkins_libs') _
  default_pipeline();
  </code></pre>
  
  <p>The library (var/default_pipeline.groovy):</p>
  
  <pre><code>def call() {
  pipeline {
    node { &lt;snip&gt; }
    stages {
      stage('Lint and style') {
        steps {
        //stuff
        }
      }
      //etc...
      stage('Post-build') {
        steps {
          PostBuildStep();
        }
      }
    }
  }
  
  def PostBuildStep() {
    echo 'Running default post-build step';
  }
  </code></pre>
  
  <p>I want to be able to add a definition to the actual pipeline code in the Jenkinsfile, like so:</p>
  
  <pre><code>@Library('default_jenkins_libs') _
  
  def PostBuildStep() {
    echo 'Running customized post-build step'
    //do custom stuff
  }
  
  default_pipeline();
  </code></pre>
  
  <p>I have not been able to figure out how to do this.  I've suspect this may be doable by the library calling the object represented by the Jenkinsfile and calling its "PostBuildStep()", maybe like 'parent.PostBuildStep()" but I do not have the class structure/naming reference.</p>
  
  <p>Any suggestions?  Bottom line is, I want a standardized pipeline that is changeable en masse via a library change, but still give some control to jobs that use it.</p>
  
  <p>TIA</p>