Deploy maven artifacts without rebuilding

We use a declarative pipeline, the latest Jenkins. The build is performed in a docker subordinate container that has maven and other tools. Our current Jenkinsfile resembles this:

stage('build') { steps { sh 'mvn clean install'} }
stage('test') { /* functional tests using a different tool */ }
stage('publish') { 
    steps {
      // mvn clean deploy -DskipTests -DaltDeploymentRepository... (rebuilds, which we want to avoid, as its a multimodule project)
      // withMaven(options:[artifactsPublisher()] { } ... (from maven-pipeline-plugin)
    }
}

In classic Jenkins mode, there is a Maven integration plugin that contains the section "Deploy artifacts to the Maven repository", in which Maven RedeployPublisher uses only artifact publications. I am looking for the pipeline equivalent of this, I thought that maven-pipe-plugin does this, but cannot find an example. Any pointers appreciated!

+4
source share
1 answer

, , , , :

stage('Deploy') {
    sh "'${mvnHome}/bin/mvn' war:war deploy:deploy"
}

, war: war , ( jar:jar ear:ear). , , , maven-war-plugin, maven-jar-plugin, forceCreation war.

+2

Source: https://habr.com/ru/post/1683911/


All Articles