-
-
Notifications
You must be signed in to change notification settings - Fork 668
Expand file tree
/
Copy pathJenkinsfile
More file actions
59 lines (59 loc) · 1.36 KB
/
Jenkinsfile
File metadata and controls
59 lines (59 loc) · 1.36 KB
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
pipeline {
agent any
tools {
maven 'maven' // 这里的名字要和你 Jenkins 全局工具配置里的 Maven 名字一致
}
stages {
stage('Checkout SCM') {
steps {
checkout scm
}
}
stage('Clean') {
steps {
sh 'mvn clean'
}
}
stage('Compile') {
steps {
sh 'mvn compile'
}
}
stage('Test') {
steps {
sh 'mvn test'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('PMD') {
steps {
sh 'mvn pmd:pmd'
}
}
stage('JaCoCo') {
steps {
sh 'mvn jacoco:report'
}
}
stage('Site') {
steps {
sh 'mvn site -DskipTests'
}
}
stage('Package') {
steps {
sh 'mvn package -DskipTests'
}
}
}
post {
always {
// 归档制品和站点文档,这样你才能在网页上点击查看
archiveArtifacts artifacts: '**/target/*.jar, **/target/*.war, target/site/**', allowEmptyArchive: true
}
}
}