Skip to content

Commit d75ac35

Browse files
run maven in Jenkinsfile
1 parent e9a10dc commit d75ac35

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

CI.Jenkinsfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
node ("docker-light") {
22
def sourceDir = pwd()
33
try {
4+
def mavenLocalRepo = "$JENKINS_HOME/maven-local-repositories/executor-$EXECUTOR_NUMBER"
45
stage("Clean up") {
56
step([$class: 'WsCleanup'])
7+
sh "rm -rf $mavenLocalRepo"
68
}
79
stage("Checkout Code") {
810
checkout scm
911
}
10-
stage("Maven Build") {
12+
stage("Build") {
13+
withMaven(maven: "Basis",
14+
mavenLocalRepo: mavenLocalRepo,
15+
publisherStrategy: "EXPLICIT") {
16+
sh "mvn clean verify"
17+
}
18+
19+
}
20+
stage("Test with Docker") {
1121
withSonarQubeEnv {
1222
mySonarOpts="-Dsonar.login=${env.SONAR_AUTH_TOKEN} -Dsonar.host.url=${env.SONAR_HOST_URL}"
1323
if ("${env.CHANGE_BRANCH}" != "null") {

Jenkinsfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
node ("docker-light") {
22
def SOURCEDIR = pwd()
33
try {
4+
def mavenLocalRepo = "$JENKINS_HOME/maven-local-repositories/executor-$EXECUTOR_NUMBER"
45
stage("Clean up") {
56
step([$class: 'WsCleanup'])
7+
sh "rm -rf $mavenLocalRepo"
68
}
79
stage("Checkout Code") {
810
checkout scm
911
}
12+
stage("Build") {
13+
withMaven(maven: "Basis",
14+
mavenLocalRepo: mavenLocalRepo,
15+
publisherStrategy: "EXPLICIT") {
16+
sh "mvn clean verify"
17+
}
18+
19+
}
1020
stage("Test with Docker") {
1121
echo "${env.ALT_URL}"
1222
def useUrl = ("${env.ALT_URL}" == "null") ? "${env.BINDING_TEST_URL}" : "${env.ALT_URL}"

0 commit comments

Comments
 (0)