function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DavidvzlaDavidvzla 

deploying metadata migration tool

Hello friends,

I,ve been trying to deploy some metadata in the DE org thru Ant, I am pretty sure I've enter the correct username, password+security token and the url, but it keeps saying:

BUILD FAILED
D:\Salesforce Migration Tool\salesforce_ant_38.0\sample\build.xml:60: Invalid username, password, security token; or user locked out.

I don't know what else to try, if someone can help me I would appreciate it, thanks a lot.
 
Best Answer chosen by Davidvzla
Lalit Mistry 21Lalit Mistry 21
In case you are deploying classes to production environment, then yes you need to test all classes successfully and total test coverage should be greater than 75%.
In case you are deploying to another sandbox or dev environment then you don't need to test your classes.

All Answers

Lalit Mistry 21Lalit Mistry 21
Hi David
Checkout for 2 things.
Firstly ensure the username and password used in D:\Salesforce Migration Tool\salesforce_ant_38.0\sample\build.xml is the same as mentioned in property file
Secondly ensure you are referring to property file stored at D:\Salesforce Migration Tool\salesforce_ant_38.0\sample\build.properties and not any other.
DavidvzlaDavidvzla
Hello Lalit, thank you for your response. 
I checked the information in the build.xml and everything seems ok, it is referencing to the build.properties.xml file fine I think. 

<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce">

    <property file="build.properties"/>
    <property environment="env"/>
    <condition property="sf.username" value=""> <not> <isset property="sf.username"/> </not> </condition>
    <condition property="sf.password" value=""> <not> <isset property="sf.password"/> </not> </condition>
    <condition property="sf.sessionId" value=""> <not> <isset property="sf.sessionId"/> </not> </condition>

    <taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
        <classpath>
            <pathelement location="../ant-salesforce.jar" />            
        </classpath>
    </taskdef>


for the second thing I think it is referencing locally:     <property file="build.properties"/>
so I honestly don't know what else to do, do you think I might installed something wrong?.

Again, thank you so mucho for your help my friend.
DavidvzlaDavidvzla
Hello my frien, I were able to connect, but know my question is, If I am deploying 100 apex classes, do I need to test the 100 classes ?
Lalit Mistry 21Lalit Mistry 21
In case you are deploying classes to production environment, then yes you need to test all classes successfully and total test coverage should be greater than 75%.
In case you are deploying to another sandbox or dev environment then you don't need to test your classes.
This was selected as the best answer
DavidvzlaDavidvzla
Thank you so much Lalit. I just erased the testLevel and It went thru. Thanks for your help !!