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

Specifying -file PATH under Targets for "Invoke Ant" causes working directory to be set incorrectly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ant-plugin
    • None

      When specifying a path to a build file under "Build File" (ie BuildFolder/build.xml), the Ant plugin will change the working directory to "BuildFolder" and run ant with the argument "-file build.xml". However when manually specifying -file BuilderFolder/build.xml under "Targets", the Ant plugin will STILL change the working directory, but this time not modify the -file path. 

      This causes Ant to fail.

      I would expect that when leaving "Build File" blank, it would use the root directory of the Jenkins workspace. 

       

      The bug can be easily observed by replacing the ant binary with this simple shell script that prints the supplied arguments as well as the current working directory

      #!/bin/sh
      echo ${@}
      pwd
       

      I have attached screenshot of Jenkins configuration + output 

       

       

      This bug is observed on Jenkins 2.130 with Ant plugin version 1.8  (but it seems like this issue is not new, as it is also seen on Jenkins 1.595 with Ant plugin version 1.2

            armfergom Armando Fernandez
            smikkelsen Steffen Mikkelsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: