I have setup force.com migration tool with 40.0 version and java version "1.8.0_40" and Apache Ant(TM) version 1.9.4 compiled on April 29 2014 on my local machine. When i try to deploy the changes using the tool and specify the testLevel="RunLocalTests" i am getting the error

BUILD FAILED /Documents/Projects/SalesforceMigrationTool/salesforce_ant_40.0/sample/build.xml:74: sf:deploy doesn't support the "testLevel" attribute.

I have specified version as 40.0 in my package.xml also, but still no luck. i did not understand what i am missing here.

Thanks! in advance.

2 Answers 2


I had the same issue and resolved it by updating the ant-salesforce.jar in my Ant installation folder. Here are the steps I took:

  1. Run the following command to find where Ant is running from on my machine:

    ant -diagnostics | grep ant.home

  2. For me, this returned:

    ant.home : /usr/local/Cellar/ant/1.9.6/libexec

  3. I checked this folder, and found that there was a ant-salesforce.jar file in the 'lib' directory. This was out of date, and as per Salesforce documentation, if you have ant-salesforce.jar in your Ant installation folder it will always use that by default when you run a deploy. So I needed to delete this file.

  4. Next, I downloaded the latest Ant Migration Tool from Salesforce (check their website). When you've got it, unzip the folder. In terminal, navigate to the newly unzipped folder, and copy the latest version of the Migration tool to the lib folder in your ant home (I don't think you strictly need to do it these days, and you might be able to just define it in your build.xml, but I didn't do that). For me, that was:

    cp ant-salesforce.jar /usr/local/Cellar/ant/1.9.6/libexec/lib

After this, it worked OK.


That error is from the migration tool jar, so you might have an old one on your classpath. Check which lib you're referring to in the build.xml file and run this on it to make sure that the dates line up with the release you think you're on: jar -vtf ant-salesforce.jar

  • Thanks for your response. But my build.xml is pointing to the same ant-salesforce.jar where i am running the ant <pathelement location="../ant-salesforce.jar" /> . The folder is extracted from zip file that i downloaded. Jul 12, 2017 at 10:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .