Ravi
Ravi

Reputation: 1232

Specify memory for ant maven deploy task

I am using ant maven deploy task to upload the zip file created by the ant script to our repository, but the problem is the file is too big and it fails with java.lang.OutOfMemoryError: Java heap space. Following is the task

    <deploy uniqueversion="false">
      <remoterepository url="${repository}" id="${repositoryId}"/>
      <remotesnapshotrepository url="${snapshotRepository}" id="${snapshotRepositoryId}"/>
  <attach file="target/${qname}-dist.zip" type="zip"/>
  <pom file="pom.xml" groupid="com.my.company" artifactid="test" packaging="zip" version="${version}" />

</deploy>

How do I specify memory heap size here, I don't seem to find anything in deploy task or some of its children task.

Upvotes: 1

Views: 615

Answers (1)

Chris
Chris

Reputation: 23171

Maven doesn't fork on the deploy task so to increase the memory, you have to increase the heap size for the maven executable itself. You can just set your MAVEN_OPTS environment variable to include the -Xmx setting: MAVEN_OPTS=”-Xmx512m”

Upvotes: 1

Related Questions