java.io.IOException: Cannot run program "C:\Software\apache-maven-3.1.1\bin\mvn.bat" (in directory "G:\JenkinsData\JenkinsHome\jobs\test-one\workspace"): Argument has embedded quote, use the explicit CMD.EXE call.

Jenkins JIRA | Tomasz Ptak | 2 years ago
  1. 0

    Reproduction 1. I created a sample freestyle job (it doesn't do anything and makes no sense, event the pom is not there) and added "Invoke top-level Maven targets" step. 2. I selected "This build is parametrized" and added many types of parameters (both default and coming from other plugins): - text parameter - boolean value - build selector for copy artifact - password parameter - string parameter 3. When the project is run, all parameters are added as "-Dkey=value" to Maven invocation: {quote} [workspace] $ C:\Software\apache-maven-3.1.1\bin\mvn.bat -f pom.xml "-Dtext=abcd efgh" '-Dcopyartifactselector=<StatusBuildSelector plugin="copyartifact@1.28"> <stable>true</stable></StatusBuildSelector>' "-Dstring=string asdasd" -Dbool=true ******** clean FATAL: command execution failed java.io.IOException: Cannot run program "C:\Software\apache-maven-3.1.1\bin\mvn.bat" (in directory "G:\JenkinsData\JenkinsHome\jobs\test-one\workspace"): Argument has embedded quote, use the explicit CMD.EXE call. at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:773) at hudson.Launcher$ProcStarter.start(Launcher.java:353) at hudson.Launcher$ProcStarter.join(Launcher.java:360) at hudson.tasks.Maven.perform(Maven.java:329) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:562) at hudson.model.Run.execute(Run.java:1665) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:246) Caused by: java.lang.IllegalArgumentException: Argument has embedded quote, use the explicit CMD.EXE call. at java.lang.ProcessImpl.isQuoted(Unknown Source) at java.lang.ProcessImpl.needsEscaping(Unknown Source) at java.lang.ProcessImpl.createCommandLine(Unknown Source) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 16 more {quote} Why are parameters implicitly included in the call? Is there a way to disable this behaviour? I would expect the step to require explicit parameters provisioning through Properties field in the config.

    Jenkins JIRA | 2 years ago | Tomasz Ptak
    java.io.IOException: Cannot run program "C:\Software\apache-maven-3.1.1\bin\mvn.bat" (in directory "G:\JenkinsData\JenkinsHome\jobs\test-one\workspace"): Argument has embedded quote, use the explicit CMD.EXE call.
  2. 0

    Reproduction 1. I created a sample freestyle job (it doesn't do anything and makes no sense, event the pom is not there) and added "Invoke top-level Maven targets" step. 2. I selected "This build is parametrized" and added many types of parameters (both default and coming from other plugins): - text parameter - boolean value - build selector for copy artifact - password parameter - string parameter 3. When the project is run, all parameters are added as "-Dkey=value" to Maven invocation: {quote} [workspace] $ C:\Software\apache-maven-3.1.1\bin\mvn.bat -f pom.xml "-Dtext=abcd efgh" '-Dcopyartifactselector=<StatusBuildSelector plugin="copyartifact@1.28"> <stable>true</stable></StatusBuildSelector>' "-Dstring=string asdasd" -Dbool=true ******** clean FATAL: command execution failed java.io.IOException: Cannot run program "C:\Software\apache-maven-3.1.1\bin\mvn.bat" (in directory "G:\JenkinsData\JenkinsHome\jobs\test-one\workspace"): Argument has embedded quote, use the explicit CMD.EXE call. at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:773) at hudson.Launcher$ProcStarter.start(Launcher.java:353) at hudson.Launcher$ProcStarter.join(Launcher.java:360) at hudson.tasks.Maven.perform(Maven.java:329) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:562) at hudson.model.Run.execute(Run.java:1665) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:246) Caused by: java.lang.IllegalArgumentException: Argument has embedded quote, use the explicit CMD.EXE call. at java.lang.ProcessImpl.isQuoted(Unknown Source) at java.lang.ProcessImpl.needsEscaping(Unknown Source) at java.lang.ProcessImpl.createCommandLine(Unknown Source) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 16 more {quote} Why are parameters implicitly included in the call? Is there a way to disable this behaviour? I would expect the step to require explicit parameters provisioning through Properties field in the config.

    Jenkins JIRA | 2 years ago | Tomasz Ptak
    java.io.IOException: Cannot run program "C:\Software\apache-maven-3.1.1\bin\mvn.bat" (in directory "G:\JenkinsData\JenkinsHome\jobs\test-one\workspace"): Argument has embedded quote, use the explicit CMD.EXE call.
  3. 0

    How to Run job on Jenkins with Selenium Server

    Stack Overflow | 1 year ago | Khalid Ksouri
    java.io.IOException: Cannot run program "cmd" (in directory "/appli/projects/jenkins_atos/jenkins/workspace/STM_V1_V2_TESTS"): java.io.IOException: error=2, No such file or directory
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Java Doc generation failing

    GitHub | 2 years ago | edanian
    java.io.IOException: Cannot run program "mvn.bat" (in directory "C:\Program Files (x86)\Jenkins\workspace\gameoflife-default"): CreateProcess error=2, The system cannot find the file specified
  6. 0

    Ant with Hudson

    Stack Overflow | 6 years ago | Kumar
    java.io.IOException: Cannot run program "ant" (in directory "/root/.hudson/jobs/userCentral/workspace/branches/branches/build"): java.io.IOException: error=2, No such file or directory

  1. eti22 1 times, last 1 month ago
  2. asdasd 24 times, last 3 months ago
  3. rexgreenza 8 times, last 3 months ago
  4. Benj-AD 1 times, last 4 months ago
  5. Akshay 4 times, last 6 months ago
95 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalArgumentException

    Argument has embedded quote, use the explicit CMD.EXE call.

    at java.lang.ProcessImpl.isQuoted()
  2. Java RT
    ProcessBuilder.start
    1. java.lang.ProcessImpl.isQuoted(Unknown Source)
    2. java.lang.ProcessImpl.needsEscaping(Unknown Source)
    3. java.lang.ProcessImpl.createCommandLine(Unknown Source)
    4. java.lang.ProcessImpl.<init>(Unknown Source)
    5. java.lang.ProcessImpl.start(Unknown Source)
    6. java.lang.ProcessBuilder.start(Unknown Source)
    6 frames
  3. Hudson
    Executor.run
    1. hudson.Proc$LocalProc.<init>(Proc.java:244)
    2. hudson.Proc$LocalProc.<init>(Proc.java:216)
    3. hudson.Launcher$LocalLauncher.launch(Launcher.java:773)
    4. hudson.Launcher$ProcStarter.start(Launcher.java:353)
    5. hudson.Launcher$ProcStarter.join(Launcher.java:360)
    6. hudson.tasks.Maven.perform(Maven.java:329)
    7. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    8. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781)
    9. hudson.model.Build$BuildExecution.build(Build.java:199)
    10. hudson.model.Build$BuildExecution.doRun(Build.java:160)
    11. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:562)
    12. hudson.model.Run.execute(Run.java:1665)
    13. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    14. hudson.model.ResourceController.execute(ResourceController.java:88)
    15. hudson.model.Executor.run(Executor.java:246)
    15 frames