Skip to content
This repository was archived by the owner on Nov 23, 2021. It is now read-only.

Commit bda26a9

Browse files
committed
Add batch option for maven command
1 parent 1759f61 commit bda26a9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Jenkinsfile-on-prem

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ pipeline {
4646
stage ('unit test') {
4747
steps {
4848
container ('maven') {
49-
sh 'mvn clean -o -gs `pwd`/configuration/settings.xml test'
49+
sh 'mvn -B -o -gs `pwd`/configuration/settings.xml clean test'
5050
}
5151
}
5252
}
5353

5454
stage ('build & push') {
5555
steps {
5656
container ('maven') {
57-
sh 'mvn -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
57+
sh 'mvn -B -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
5858
sh 'docker build -f Dockerfile-on-prem -t $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .'
5959
withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$HARBOR_CREDENTIAL_ID" ,)]) {
6060
sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin'

Jenkinsfile-online

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ pipeline {
2929
stage ('unit test') {
3030
steps {
3131
container ('maven') {
32-
sh 'mvn clean -gs `pwd`/configuration/settings.xml test'
32+
sh 'mvn -B -gs `pwd`/configuration/settings.xml clean test'
3333
}
3434
}
3535
}
3636

3737
stage ('build & push') {
3838
steps {
3939
container ('maven') {
40-
sh 'mvn -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
40+
sh 'mvn -B -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
4141
sh 'docker build -f Dockerfile-online -t $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .'
4242
withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKER_CREDENTIAL_ID" ,)]) {
4343
sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin'

0 commit comments

Comments
 (0)