forked from koddas/war-web-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
47 lines (47 loc) · 1.25 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
pipeline {
agent any
tools {
maven 'Maven363'
}
options {
timeout(10)
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '5', numToKeepStr: '5')
}
stages {
stage('Build') {
steps {
sh "mvn clean install"
}
}
stage('upload artifact to nexus') {
steps {
nexusArtifactUploader artifacts: [
[
artifactId: 'wwp',
classifier: '',
file: 'target/wwp-1.0.0.war',
type: 'war'
]
],
credentialsId: 'nexus3',
groupId: 'koddas.web.war',
nexusUrl: '10.0.0.91:8081',
nexusVersion: 'nexus3',
protocol: 'http',
repository: 'samplerepo',
version: '1.0.0'
}
}
}
post {
always{
deleteDir()
}
failure {
echo "sendmail -s mvn build failed [email protected]"
}
success {
echo "The job is successful"
}
}
}