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

Shell arguments containing & should be escaped on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • core
    • None
    • Windows

      In the Sonar plugin we are using ArgumentListBuilder to create the command line to be executed for sonar analysis.
      In case we add a parameter containing a & (for example -Dsonar.jdbc.url=jdbc:mysql://192.168.0.13:3306/sonar?useUnicode=true&characterEncoding=utf8) the execution fails on Windows because the parameter should be escaped.
      Produced command line:

      c:\jenkins\tools\Sonar_Runner\Sonar_runner_2.0\bin\sonar-runner.bat -Dsonar.jdbc.driver=com.mysql.jdbc.Driver -Dsonar.jdbc.url=jdbc:mysql://192.168.0.13:3306/sonar?useUnicode=true&characterEncoding=utf8 ******** ******** -Dsonar.host.url=http://192.168.0.13:9000 "-Dsonar.projectBaseDir=c:\jenkins\workspace\Freestyle avec SCM" -Dsonar.projectName=Branding -Dsonar.projectVersion=1.0 -Dsources=src/main/java -Dsonar.projectKey=sonar:branding
      

      Expected:

      c:\jenkins\tools\Sonar_Runner\Sonar_runner_2.0\bin\sonar-runner.bat -Dsonar.jdbc.driver=com.mysql.jdbc.Driver "-Dsonar.jdbc.url=jdbc:mysql://192.168.0.13:3306/sonar?useUnicode=true&characterEncoding=utf8" ******** ******** -Dsonar.host.url=http://192.168.0.13:9000 "-Dsonar.projectBaseDir=c:\jenkins\workspace\Freestyle avec SCM" -Dsonar.projectName=Branding -Dsonar.projectVersion=1.0 -Dsources=src/main/java -Dsonar.projectKey=sonar:branding
      

            Unassigned Unassigned
            henryju Julien HENRY
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: