Jenkins Docker Pipeline Maven Build Example

Опубликовано: 30 Ноябрь 2020
на канале: Cameron McKenzie
7,253
54

Here's a quick tutorial to show you how to build a Maven project with a Docker based Jenkins pipeline. Very quick and simple, as long as you have Jenkins, Docker and Git installed, the pipeline will use a container to both pull from GitHub and run the Apache Maven compile, test and install commands to required to trigger the build of your Java application. If you were looking for a simple example of how to create a Jenkins Docker Pipeline to build Maven projects hosted on GitHub, this JenkinsCI tutorial is right for you.

pipeline {
agent { docker { image 'maven:3.3.3' } }
stages {
stage('log version info') {
steps {
git 'https://github.com/learn-devops-fast/...
sh 'mvn --version'
sh 'mvn clean install'
}
}
}
}