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

Invoke Ant - Build failed if parameters contain spaces due to changes in quotes since 1.653

    XMLWordPrintable

Details

    Description

      IStarting from Jenkins 1.653 with the same plugins versions we noticed that the ant command is created differently and it does not work with our configuration.

      Add build step Invoke Ant with the following values:

      Ant Version: ANT_1.9.4
      Targets: -lib D:\ANT_1.9.4\ANT_libs Alpha.i
      Build File: buildInstallers.xml
      Properties:
      iaPath=${InstallAnywhereLocation}
      iaOutputDir=$WORKSPACE
      iaMergeModulesDir=

      buildView=$WORKSPACE
      buildLogsPath=$WORKSPACE
      installersPath=$WORKSPACE

      1.652 - Command output
      cmd.exe /C '"D:\ANT_1.9.4\bin\ant.bat -file buildInstallers.xml -DiaOutputDir=D:\JENKINS-WS\Alpha\workspace "-DiaPath=C:\Program Files (x86)\InstallAnywhere 2015" -DbuildLogsPath=D:\JENKINS-WS\Alpha\workspace -DiaMergeModulesDir="" -DbuildView=D:\JENKINS-WS\Alpha\workspace -DinstallersPath=D:\JENKINS-WS\Alpha\workspace -lib D:\ANT_1.9.4\ANT_libs Alpha.i && exit %%ERRORLEVEL%%"'

      1.653 and 1.654 - Command output
      cmd.exe /C "D:\ANT_1.9.4\bin\ant.bat -file buildInstallers.xml -DiaOutputDir=D:\JENKINS-WS\Alpha\workspace '"-DiaPath=C:\Program Files (x86)\InstallAnywhere 2015"' -DbuildLogsPath=D:\JENKINS-WS\Alpha\workspace -DiaMergeModulesDir= -DbuildView=D:\JENKINS-WS\Alpha\workspace -DinstallersPath=D:\JENKINS-WS\Alpha\workspace -lib D:\ANT_1.9.4\ANT_libs Alpha.i && exit %%ERRORLEVEL%%"

      BUILD FAILED
      Target "D:\JENKINS-WS\Alpha\workspace" does not exist in the project "TNMS Installers".

      Attachments

        Issue Links

          Activity

            Hi, the 1.3 version has been released. hugo_reis, can you try it, please?

            escoem Emilio Escobar added a comment - Hi, the 1.3 version has been released. hugo_reis , can you try it, please?

            For me the 1.3 is working.

            The quotes are different to the initial version, i.e. all parameters with blanks are now quoted both with ' and ". But it seems to be plausible and is working now.

            cmd.exe /C "ant.bat -file postResultsToRTC.xml -DbuildResultUUID="" '"-DrtcBuildDefinitionId=My_Test Jenkins build"' -DrtcRepositoryAddress=https://repository-server.com/ccm '"-DrtcBuildEngineId=My_Test Jenkins engine"' '"-DjenkinsJobDisplayName=#211 - SVN revision r2437"' -DjenkinsJobBuildURL=http://myaddress.com:8080/job/Test/job/trunk-restructured-CBA/211/ -lib C:\IBM\TeamConcertBuild\buildsystem\buildtoolkit all && exit %%ERRORLEVEL%%"
            

            Thanks for the fix!

            chrop Christian Opitz added a comment - For me the 1.3 is working. The quotes are different to the initial version, i.e. all parameters with blanks are now quoted both with ' and ". But it seems to be plausible and is working now. cmd.exe /C "ant.bat -file postResultsToRTC.xml -DbuildResultUUID=" " '" -DrtcBuildDefinitionId=My_Test Jenkins build "' -DrtcRepositoryAddress=https: //repository-server.com/ccm '" -DrtcBuildEngineId=My_Test Jenkins engine "' '" -DjenkinsJobDisplayName=#211 - SVN revision r2437 "' -DjenkinsJobBuildURL=http://myaddress.com:8080/job/Test/job/trunk-restructured-CBA/211/ -lib C:\IBM\TeamConcertBuild\buildsystem\buildtoolkit all && exit %%ERRORLEVEL%%" Thanks for the fix!
            hugo_reis Hugo Reis added a comment -

            Tested successfully:

            • Jenkins 1.652 with Ant plugin 1.3
            • Jenkins 2.3 with Ant plugin 1.3

            escoem you can close this issue.

            Thanks for the support.

            hugo_reis Hugo Reis added a comment - Tested successfully: Jenkins 1.652 with Ant plugin 1.3 Jenkins 2.3 with Ant plugin 1.3 escoem you can close this issue. Thanks for the support.
            yucey Ugur Ceylan added a comment -

            Hi,

            With Jenkins 2.23 and ant-plugin 1.4 problem still occurs. BUILD_SELECTOR parameter is injected by the copy artifact plugin.

            cmd.exe /C "D:\work\tools\sfw\ant\bin\ant.bat -file build_jenkins.xml '"-DBUILD_SELECTOR=<StatusBuildSelector plugin=""copyartifact@1.38.1""> <stable>true</stable></StatusBuildSelector>"' jenkins.junit.runtests && exit %%ERRORLEVEL%%"
            17:26:09 -Xms256m -Xmx2048m
            17:26:09 Buildfile: build_jenkins.xml
            17:26:11
            17:26:11 BUILD FAILED
            17:26:11 Target `<stable>true</stable></StatusBuildSelector> jenkins.junit.runtests' does not exist in this project.

            yucey Ugur Ceylan added a comment - Hi, With Jenkins 2.23 and ant-plugin 1.4 problem still occurs. BUILD_SELECTOR parameter is injected by the copy artifact plugin. cmd.exe /C "D:\work\tools\sfw\ant\bin\ant.bat -file build_jenkins.xml '"-DBUILD_SELECTOR=<StatusBuildSelector plugin=""copyartifact@1.38.1""> <stable>true</stable></StatusBuildSelector>"' jenkins.junit.runtests && exit %%ERRORLEVEL%%" 17:26:09 -Xms256m -Xmx2048m 17:26:09 Buildfile: build_jenkins.xml 17:26:11 17:26:11 BUILD FAILED 17:26:11 Target `<stable>true</stable></StatusBuildSelector> jenkins.junit.runtests' does not exist in this project.

            yucey I'd say it seems to be related to the two double quotes in ""copyartifact@1.38.1"", but would need to look deeper into it

            armfergom Armando Fernandez added a comment - yucey I'd say it seems to be related to the two double quotes in ""copyartifact@1.38.1"" , but would need to look deeper into it

            People

              escoem Emilio Escobar
              hugo_reis Hugo Reis
              Votes:
              4 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: