forked from Monogramm/spring-rest-api-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
60 lines (56 loc) · 1.86 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
pipeline {
agent any
tools {
maven 'Maven 3.3'
jdk 'JDK 1.8'
}
stages {
stage ('Initialize') {
steps {
sh '''
echo "PATH = ${PATH}"
java -version
echo "M2_HOME = ${M2_HOME}"
echo "MAVEN_HOME = ${MAVEN_HOME}"
mvn --version
'''
}
}
stage ('Build') {
steps {
sh 'mvn clean compile'
}
}
stage ('Test') {
steps {
sh 'mvn test'
}
post {
success {
junit 'target/surefire-reports/*.xml,target/failsafe-reports/*.xml'
}
}
}
stage ('Packaging') {
steps {
sh 'mvn package -Dmaven.test.skip=true'
}
post {
archiveArtifacts '*target/*.jar'
}
}
stage ('Reporting') {
steps {
sh 'mvn site -Dmaven.test.skip=true'
}
post {
success {
findbugs canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', pattern: '**/findbugs.xml', unHealthy: ''
checkstyle canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/checkstyle-result.xml', unHealthy: ''
pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/pmd.xml', unHealthy: ''
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'target/site', reportFiles: 'index.html', reportName: 'Maven Site Reports', reportTitles: ''])
}
}
}
}
}