Skip to content

Add Windows compatibility for Jenkins pipeline #1202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ pipeline {
stages {
stage('Build') {
steps {
sh 'mvn -B -DskipTests clean package'
bat '"%MAVEN_HOME%\\bin\\mvn" -B -DskipTests clean package'
}
}
stage('Test') {
steps {
sh 'mvn test'
bat '"%MAVEN_HOME%\\bin\\mvn" test'
}
post {
always {
Expand All @@ -21,7 +21,7 @@ pipeline {
}
stage('Deliver') {
steps {
sh './jenkins/scripts/deliver.sh'
bat 'jenkins\\scripts\\deliver.bat'
}
}
}
Expand Down
22 changes: 22 additions & 0 deletions jenkins/scripts/deliver.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@echo off
echo The following Maven command installs your Maven-built Java application
echo into the local Maven repository, which will ultimately be stored in
echo Jenkins's local Maven repository (and the "maven-repository" Docker data volume).

REM Run Maven install
mvn jar:jar install:install help:evaluate -Dexpression=project.name

echo The following command extracts the value of the <name/> element
echo within <project/> of your Java/Maven project's "pom.xml" file.

FOR /F "delims=" %%i IN ('mvn -q -DforceStdout help:evaluate -Dexpression=project.name') DO SET NAME=%%i

echo The following command behaves similarly to the previous one but
echo extracts the value of the <version/> element within <project/> instead.

FOR /F "delims=" %%i IN ('mvn -q -DforceStdout help:evaluate -Dexpression=project.version') DO SET VERSION=%%i

echo The following command runs and outputs the execution of your Java
echo application (which Jenkins built using Maven) to the Jenkins UI.

java -jar target\%NAME%-%VERSION%.jar
26 changes: 0 additions & 26 deletions jenkins/scripts/deliver.sh

This file was deleted.