Skip to content

Commit eaf1b86

Browse files
committed
Jenkins Check
1 parent bfc1fb1 commit eaf1b86

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

Jenkinsfile

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1-
pipeline { agent { docker { image 'maven:3-alpine' args '-v /root/.m2:/root/.m2' } } stages { stage('Build') { steps { sh 'mvn -B -DskipTests clean package' } } stage('Test') { steps { sh 'mvn test' } post { always { junit 'target/surefire-reports/*.xml' } } } } }
1+
node {
2+
def mvnHome
3+
stage('Preparation') { // for display purposes
4+
// Get some code from a GitHub repository
5+
git 'https://github.com/marci4/Java-WebSocket-Dev.git'
6+
// Get the Maven tool.
7+
// ** NOTE: This 'M3' Maven tool must be configured
8+
// ** in the global configuration.
9+
mvnHome = tool 'M3'
10+
}
11+
stage('Build') {
12+
// Run the maven build
13+
if (isUnix()) {
14+
sh "'${mvnHome}/bin/mvn' -Dmaven.test.failure.ignore clean package"
15+
} else {
16+
bat(/"${mvnHome}\bin\mvn" -Dmaven.test.failure.ignore clean package/)
17+
}
18+
}
19+
stage('Test') {
20+
if (isUnix()) {
21+
sh "'${mvnHome}/bin/mvn' test package"
22+
} else {
23+
bat(/"${mvnHome}\bin\mvn" test package/)
24+
}
25+
}
26+
stage('Results') {
27+
junit '**/target/surefire-reports/TEST-*.xml'
28+
archive 'target/*.jar'
29+
}
30+
}

0 commit comments

Comments
 (0)