def deployStage()

in vars/vaultStageDeploy.groovy [23:41]


def deployStage(final PipelineSupport pipelineSupport) {
    final String wagonPluginGav = "org.codehaus.mojo:wagon-maven-plugin:2.0.2"
    stage("Deployment to Maven Repository") {
        node('nexus-deploy') {
            timeout(60) {
                echo "Running on node ${env.NODE_NAME}"
                // first clear workspace
                deleteDir()
                // Nexus deployment needs pom.xml
                checkout scm
                // Unstash the previously stashed build results.
                unstash name: 'local-snapshots-dir'
                // https://www.mojohaus.org/wagon-maven-plugin/merge-maven-repos-mojo.html
                String mavenArguments = "${wagonPluginGav}:merge-maven-repos -Dwagon.target=https://repository.apache.org/content/repositories/snapshots -Dwagon.targetId=apache.snapshots.https -Dwagon.source=file:${env.WORKSPACE}/local-snapshots-dir"
                pipelineSupport.executeMaven(this, mavenArguments, false)
            }
        }
    }
}