Issue
I have a spring batch application packaged as a jar file.
I could execute the jar as mentioned below in the windows cmd prompt
java -Xms2048m -Xmx2048m -Ddivision=25 -Ddate= -Denv=dv -Dconn=45 -jar demo-jobs*.jar job-definition.xml jobName -next
however the above command fails in the bash shell (installed in windows) with the following error
In CMD Prompt:
Job Terminated in error: IOException parsing XML document from Class Path Resource c:/directory/job-definition.xml
In POM.XML:
Solution
The problem is with the path separators used, in cdm the interpreter is treating this path as an absolute path starting from the root of the drive you are running this.
Git bash however, mangles the provided paths and translates it, adding the current git execution path to the provided path arguments, that's why you see the temp directory in front of your provided path. If you specify command-line options starting with a slash, POSIX-to-Windows path conversion will kick in converting e.g. "/usr/bin/bash.exe" to "C:\Program Files\Git\usr\bin\bash.exe".
What you could do is add //
at the beginning of your path for the bash - //spring/batch/...
Answered By - Bon