Hi, The language is perfectly capable to deal with spaces and backslashes, but the bat statement, or rather cmd.exe behind it, splits the statement at white spaces. To avoid the splitting, enclose the command in double quotes, inside of the string.
Please try to write the bat statement it like this and let us know: > node { > git url: 'https://github.com/jglick/simple-maven-project-with-tests.git' > def mvnHome = tool 'maven-3.2.5' > bat "\"${mvnHome}\\bin\\mvn\" -B verify" > } Best Regards, Peter > Am 06.04.2015 um 11:06 schrieb ELIASSAL <sa...@altern.org>: > > > Well Richard, when I have setup maven; O followed instructions and placed it > in C:\Program Files...........But any programming language should be able to > handle this > On Saturday, April 4, 2015 at 1:56:32 PM UTC+2, ELIASSAL wrote: > Hi, I am following the basic tutorial > https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md, the > piecs of script > node { > git url: 'https://github.com/jglick/simple-maven-project-with-tests.git' > def mvnHome = tool 'maven-3.2.5' > bat "${mvnHome}\\bin\\mvn -B verify" > } > > is failing at line bat "${mvnHome}\\bin\\mvn -B verify" with the following > error > 'C:\Program' is not recognized as an internal or external command, > > I replaced this with > bat "C:\\M3\\bin\\mvn -B verify" > > and it worked fine. So what is the solution to use variables that can have > Backslashes -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9CD01667-4B01-420F-9E5E-2554336EFF38%40web.de. For more options, visit https://groups.google.com/d/optout.