Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-23831

Multiline (all) job parameters passed to "Invoke top-level Maven targets" step

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • Jenkins 1.532.1
      Maven plugin 2.0.2

      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:

      [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

      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.

            Unassigned Unassigned
            tptak Tomasz Ptak
            Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: