32 lines
935 B
Plaintext
32 lines
935 B
Plaintext
pipeline {
|
|
agent {label 'docker-alpine-agent'}
|
|
|
|
tools {
|
|
// Install the Maven version configured as "M3" and add it to the path.
|
|
maven "M3"
|
|
}
|
|
|
|
stages {
|
|
stage('Checkout') {
|
|
steps {
|
|
// Get some code from a GitHub repository
|
|
git 'https://github.com/jglick/simple-maven-project-with-tests.git'
|
|
}
|
|
}
|
|
stage('Build'){
|
|
steps {
|
|
// Run Maven on a Unix agent.
|
|
sh "mvn -Dmaven.test.failure.ignore=true clean package"
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
// If Maven was able to run the tests, even if some of the test
|
|
// failed, record the test results and archive the jar file.
|
|
success {
|
|
junit '**/target/surefire-reports/TEST-*.xml'
|
|
archiveArtifacts 'target/*.jar'
|
|
}
|
|
}
|
|
} |