-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathJenkinsfile
48 lines (47 loc) · 1019 Bytes
/
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
pipeline {
agent any
tools {
maven 'Maven-3.9'
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build & Publish') {
agent {
docker {
image 'registry.x1/j7beck/x1-maven3:jdk-1.8.0'
args '-v $HOME/.m2/repository:/var/lib/jenkins/.m2/repository'
reuseNode true
}
}
stages {
stage('Build') {
steps {
sh '$MAVEN_HOME/bin/mvn -B clean package'
}
}
stage('Publish') {
steps {
sh '$MAVEN_HOME/bin/mvn -B deploy site-deploy -DskipTests'
}
}
}
}
stage('Sonar') {
tools {
jdk 'JDK-17'
}
steps {
sh 'mvn sonar:sonar -DskipTests -Dsonar.java.coveragePlugin=jacoco -Dsonar.jacoco.reportPath=target/jacoco.exec -Dsonar.host.url=https://www.x1/sonar'
}
}
}
post {
always {
recordIssues tools: [spotBugs(pattern: 'target/spotbugsXml.xml')]
}
}
}