+ Start a Discussion
Natraj Subramani 15Natraj Subramani 15 

Azure DevOps Salesforce ANT Migration Error

Hi All,

I am getting the below error when I am trying to run a build in Azure Devops for a Salesforce deployment. 

Does any one know how to specify ANT_OPTS in Azure Devops to avoid this error ?

Any other tips or workaround is also appreciated.


BUILD FAILED
/home/vsts/work/1/s/build/build.xml:32: java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:3236)
    at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
    at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
    at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
    at sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:78)
    at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:253)
    at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:211)
    at java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:145)
    at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
    at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282)
    at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)
    at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)
    at java.io.OutputStreamWriter.write(OutputStreamWriter.java:220)
    at java.io.Writer.write(Writer.java:157)
    at com.sforce.ws.parser.MXSerializer.writeElementContent(MXSerializer.java:1005)
    at com.sforce.ws.parser.MXSerializer.text(MXSerializer.java:802)
    at com.sforce.ws.parser.XmlOutputStream.writeText(XmlOutputStream.java:103)
    at com.sforce.ws.bind.TypeMapper.writeSimpleType(TypeMapper.java:306)
    at com.sforce.ws.bind.TypeMapper.writeSingleObject(TypeMapper.java:397)
    at com.sforce.ws.bind.TypeMapper.writeObject(TypeMapper.java:369)
    at com.sforce.soap.metadata.Deploy_element.writeFieldZipFile(Deploy_element.java:51)
    at com.sforce.soap.metadata.Deploy_element.writeFields1(Deploy_element.java:129)
    at com.sforce.soap.metadata.Deploy_element.writeFields(Deploy_element.java:97)
    at com.sforce.soap.metadata.Deploy_element.write(Deploy_element.java:90)
    at com.sforce.ws.transport.SoapConnection.writeBody(SoapConnection.java:366)
    at com.sforce.ws.transport.SoapConnection.sendRequest(SoapConnection.java:337)
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:96)
    at com.sforce.soap.metadata.MetadataConnection.deploy(MetadataConnection.java:351)
    at com.salesforce.ant.DeployTask.submitMessage(DeployTask.java:326)
    at com.salesforce.ant.SFDCMDAPIAntTaskRunner.runTask(SFDCMDAPIAntTaskRunner.java:29)
    at com.salesforce.ant.DeployTask.execute(DeployTask.java:63)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
Total time: 28 seconds
The process '/usr/bin/ant' failed with exit code 1
##[error]Error: The process '/usr/bin/ant' failed with exit code 1

Thanks
Natraj
Rohit RadhakrishnanRohit Radhakrishnan
Can you please take a look at this blog and setup the pipeline.
https://salesforcerealm.com/2020/05/17/ado-for-sfdc-devs/

Regards,
Rohit