• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • ant-plugin
    • None
    • Windows Server 2012, Windows 7
      Jenkins 1.634
      Ant plugin 1.2
      copyartifact plugin 1.36.1
      chrome browser, IE 11 browser

      Using BuildSelector to give a specific build number the CopyArtifact plugin step works fine.

      In a later step we run an ant script to deploy the artifacts in deploy job workspace now.

      The Ant generated parameter that appears to cause problem is "-DTARGET_BUILD=<SpecificBuildSelector plugin=""copyartifact@1.36.1""> <buildNumber>66</buildNumber></SpecificBuildSelector>"

      When runs gets error
      Target "<buildNumber>66</buildNumber></SpecificBuildSelector> -DBUILD_USER=xxxx" does not exist in the project

      This prevents running deploy job.

      The same deploy job running on Jenkins 1.476 and CopyArtifact plugin 1.29 and Ant 1.1 works.

      We are attempting to upgrade to a newer version of Jenkins and all the newer version use ant 1.2.

          [JENKINS-31114] Ant escape incorrectly on Windows

          Ruan Berg created issue -

          ikedam added a comment -

          This looks an issue of ant-plugin (or might be that of Jenkins core?)
          Removed copyartifact from component/s.

          ikedam added a comment - This looks an issue of ant-plugin (or might be that of Jenkins core?) Removed copyartifact from component/s.
          ikedam made changes -
          Component/s Original: copyartifact-plugin [ 15692 ]

          Hi rberg,

          I recently took over manintainership of the Ant Plugin and got 1.3 released earlier this week. It should fix your issue. Please, could you confirm so that I can close this ticket?

          Thanks,
          Armando

          Armando Fernandez added a comment - Hi rberg , I recently took over manintainership of the Ant Plugin and got 1.3 released earlier this week. It should fix your issue. Please, could you confirm so that I can close this ticket? Thanks, Armando
          Armando Fernandez made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Armando Fernandez made changes -
          Assignee New: Armando Fernandez [ armfergom ]

          Ruan Berg added a comment -

          it still fails after installing Ant Plugin 1.3

          [Batch.BatchControl.Deploy] $ cmd.exe /C "ant.bat -file AppDeploy.xml -DDEPLOY_ENV=IST '"-DTARGET_BUILD=<SpecificBuildSelector plugin=""copyartifact@1.38""> <buildNumber>65</buildNumber></SpecificBuildSelector>"' do_all -Djenkins.PREVJOBNAME=Batch.BatchControl -DSKIP_SERVICE_STEPS=true && exit %%ERRORLEVEL%%" Buildfile: ..\AppDeploy.xml [echo] Beginning Build of ..\AppDeployv5.xml with Ant Version Apache Ant(TM) version 1.9.6 compiled on June 29 2015... BUILD FAILED Target "<buildNumber>65</buildNumber></SpecificBuildSelector> do_all -Djenkins.PREVJOBNAME Batch.BatchControl -DSKIP_SERVICE_STEPS true" does not exist in the project "Web_Bld".

          Ruan Berg added a comment - it still fails after installing Ant Plugin 1.3 [Batch.BatchControl.Deploy] $ cmd.exe /C "ant.bat -file AppDeploy.xml -DDEPLOY_ENV=IST '"-DTARGET_BUILD=<SpecificBuildSelector plugin=""copyartifact@1.38""> <buildNumber>65</buildNumber></SpecificBuildSelector>"' do_all -Djenkins.PREVJOBNAME=Batch.BatchControl -DSKIP_SERVICE_STEPS=true && exit %%ERRORLEVEL%%" Buildfile: ..\AppDeploy.xml [echo] Beginning Build of ..\AppDeployv5.xml with Ant Version Apache Ant(TM) version 1.9.6 compiled on June 29 2015... BUILD FAILED Target "<buildNumber>65</buildNumber></SpecificBuildSelector> do_all -Djenkins.PREVJOBNAME Batch.BatchControl -DSKIP_SERVICE_STEPS true" does not exist in the project "Web_Bld".
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 166286 ] New: JNJira + In-Review [ 185646 ]

          Stephen Baker added a comment - - edited

          I'm hitting this on 1.4 as well:

          ```
          [BoolParser] $ cmd.exe /C '""C:\Program Files (x86)\Jenkins\tools\hudson.tasks.Ant_AntInstallation\Ant\bin\ant.bat"' -file build.xml -DGERRIT_BRANCH=develop -DGERRIT_PATCHSET_REVISION=65bed5205cb0ff069516de15ba02142bc1782e8a -DGERRIT_HOST=centos237.ermscorp.local -DGERRIT_CHANGE_OWNER_EMAIL=stephen.baker@example.com '"-DGERRIT_EVENT_ACCOUNT_NAME=Stephen Baker"' -DGERRIT_CHANGE_URL=http://centos237.ermscorp.local:8080/1242 -DGERRIT_PATCHSET_UPLOADER_EMAIL=stephen.baker@example.com -DGERRIT_EVENT_TYPE=patchset-created -DGERRIT_PROJECT=erms -DGERRIT_CHANGE_NUMBER=1242 -DGERRIT_SCHEME=ssh '"-DGERRIT_PATCHSET_UPLOADER=\""Stephen Baker\"" <stephen.baker@example.com>"' -DGERRIT_PORT=29418 -DGERRIT_REFSPEC=refs/changes/42/1242/2 '"-DGERRIT_PATCHSET_UPLOADER_NAME=Stephen Baker"' '"-DGERRIT_CHANGE_OWNER=\""Stephen Baker\"" <stephen.baker@example.com>"' -DGERRIT_CHANGE_COMMIT_MESSAGE=RmlsdGVyIHRoZSBtZW51IG9uIHRoZSBzZXJ2ZXIgc2lkZQoKQ2hhbmdlLUlkOiBJOTQ0OGFiM2RkMTUxYWVlMzhiODE0OTE5M2JlODNkZjBkMWViNDE3MQo="" '"-DGERRIT_NAME=Centos237 Gerrit Server"' -DGERRIT_TOPIC="" '"-DGERRIT_CHANGE_SUBJECT=Filter the menu on the server side"' '"-DGERRIT_EVENT_ACCOUNT=\""Stephen Baker\"" <stephen.baker@example.com>"' -DGERRIT_CHANGE_ID=I9448ab3dd151aee38b8149193be83df0d1eb4171 -DGERRIT_EVENT_HASH=-386756447 -DGERRIT_VERSION=2.11.5 -DGERRIT_EVENT_ACCOUNT_EMAIL=stephen.baker@example.com -DGERRIT_PATCHSET_NUMBER=2 '"-DGERRIT_CHANGE_OWNER_NAME=Stephen Baker"' jar && exit %%ERRORLEVEL%%"
          ```

          resulting in:
          ```
          Target "Baker"" <stephen.baker@example.com>" does not exist in the project "BoolParser".
          ```

          Stephen Baker added a comment - - edited I'm hitting this on 1.4 as well: ``` [BoolParser] $ cmd.exe /C '""C:\Program Files (x86)\Jenkins\tools\hudson.tasks.Ant_AntInstallation\Ant\bin\ant.bat"' -file build.xml -DGERRIT_BRANCH=develop -DGERRIT_PATCHSET_REVISION=65bed5205cb0ff069516de15ba02142bc1782e8a -DGERRIT_HOST=centos237.ermscorp.local -DGERRIT_CHANGE_OWNER_EMAIL=stephen.baker@example.com '"-DGERRIT_EVENT_ACCOUNT_NAME=Stephen Baker"' -DGERRIT_CHANGE_URL= http://centos237.ermscorp.local:8080/1242 -DGERRIT_PATCHSET_UPLOADER_EMAIL=stephen.baker@example.com -DGERRIT_EVENT_TYPE=patchset-created -DGERRIT_PROJECT=erms -DGERRIT_CHANGE_NUMBER=1242 -DGERRIT_SCHEME=ssh '"-DGERRIT_PATCHSET_UPLOADER=\""Stephen Baker\"" <stephen.baker@example.com>"' -DGERRIT_PORT=29418 -DGERRIT_REFSPEC=refs/changes/42/1242/2 '"-DGERRIT_PATCHSET_UPLOADER_NAME=Stephen Baker"' '"-DGERRIT_CHANGE_OWNER=\""Stephen Baker\"" <stephen.baker@example.com>"' -DGERRIT_CHANGE_COMMIT_MESSAGE=RmlsdGVyIHRoZSBtZW51IG9uIHRoZSBzZXJ2ZXIgc2lkZQoKQ2hhbmdlLUlkOiBJOTQ0OGFiM2RkMTUxYWVlMzhiODE0OTE5M2JlODNkZjBkMWViNDE3MQo="" '"-DGERRIT_NAME=Centos237 Gerrit Server"' -DGERRIT_TOPIC="" '"-DGERRIT_CHANGE_SUBJECT=Filter the menu on the server side"' '"-DGERRIT_EVENT_ACCOUNT=\""Stephen Baker\"" <stephen.baker@example.com>"' -DGERRIT_CHANGE_ID=I9448ab3dd151aee38b8149193be83df0d1eb4171 -DGERRIT_EVENT_HASH=-386756447 -DGERRIT_VERSION=2.11.5 -DGERRIT_EVENT_ACCOUNT_EMAIL=stephen.baker@example.com -DGERRIT_PATCHSET_NUMBER=2 '"-DGERRIT_CHANGE_OWNER_NAME=Stephen Baker"' jar && exit %%ERRORLEVEL%%" ``` resulting in: ``` Target "Baker"" <stephen.baker@example.com>" does not exist in the project "BoolParser". ```

          sradi added a comment -

          Hi there,

          I am facing the same issue with 1.4.
          armfergom: Can you provide a schedule, when the issue might be solved?

          If I can help with the fix, please contact me.
          I just don't have enough understanding of the code, and how to escape the command correctly, to start implementing a fix.

          sradi added a comment - Hi there, I am facing the same issue with 1.4. armfergom : Can you provide a schedule, when the issue might be solved? If I can help with the fix, please contact me. I just don't have enough understanding of the code, and how to escape the command correctly, to start implementing a fix.

            armfergom Armando Fernandez
            rberg Ruan Berg
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: