File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed
Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change 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}\b in\m vn" -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}\b in\m vn" test package/ )
24+ }
25+ }
26+ stage(' Results' ) {
27+ junit ' **/target/surefire-reports/TEST-*.xml'
28+ archive ' target/*.jar'
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments