Deploying the Apex Class Using the Apache Ant™ Migration Tool

Make sure that the latest version of Java is installed. To check if Java has been installed on your machine, navigate to command prompt and type Java-version to display the details of the Java version installed.

Note: An error message indicates that you have not installed Java on your machine, or the path to the java executable is not configured in the path environment variable.

Installing Apache Ant Migration Tool:

  1. Download the latest version of the Apache Ant tool.

  2. Extract the downloaded zip file.

  3. Navigate to Environment Variables and set the JAVA_HOME and ANT_HOME on your Windows machine.

  4. Navigate to the Path Variable and add ANT_HOME and JAVA_HOME environment bin variables in the System Variables area of the dialog.

  5. Enter this command: ANT-version in the command prompt.

    Note: If Ant tool version details are displayed, the installation is successful.

To Install Salesforce Migration Tools:

  1. Log in to your Salesforce account and download the Salesforce Migration tool from Salesforce org.

  2. Navigate to Setup and search for Tools in Quick Find.

  3. Click Lightning Platform Tools in Tools and Toolkits to view a list of Salesforce tools and toolkits.

  4. Click the Ant Migration Tool to be redirected to.

  5. Click Download the.zip file of the Summer '21 Ant Migration Tool to download the Ant tool.

    Note: The name of the download link may vary depending on the Salesforce version.

To deploy the Apex Classes into Target Salesforce Org:

  1. Extract the downloaded Salesforce_ant_V.0 Zip folder.

  2. Copy the ant-salesforce.jar from the folder and paste the copied file into the apache-ant-1.10.11\lib folder.

  3. Copy the Tidal_Apex_Bridge_Ant_Deployment.Zip file from SalesforceBridge folder to your local system.

    Note: The Tidal_Apex_Bridge_Ant_Deployment.Zip file contains Classes folder and the Package.XML file.

  4. Update the build.properties file available in salesforce_ant_V.0\sample with the target Salesforce system details:

    • Username – Salesforce username

    • Password – Password + security token

    • Server URL – (Production or Developer Edition) https://login.salesforce.com and (Sandbox) https://test.salesforce.com.

  5. Navigate to the command prompt and type ant deployCodeNoTestLevelSpecified to deploy the code to the Target system.

    A message appears confirming that the build is successful.

  6. Sign in to Target Salesforce org and verify that the classes have been deployed.

  7. Navigate to the Setup page and search for Apex Classes in the Quick Find.

    Note: For more information about installing the Ant migration tool refer to Using the Ant Migration Tool to Deploy Changes.