I am converting my ant's build.xml to maven project pom.xml using the maven-antrun-plugin and i am getting java.lang.OutOfMemoryError: Java heap space error. This error occurs when i try to copy a fairly large file 2g in to a location during build time
the code for this is simply
<copy todir="dist/${cgapp.home}/${push.root}/${cgapp.toolchain}" >
<fileset dir="${env.PUSH_TOOLCHAIN}" includes="**"/>
</copy>
Now using maven-antrun-plugin the pom.xml looks like this
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration><exportAntProperties>true</exportAntProperties>
<target>
.........
<copy verbose="true" todir="app/${cgapp.home}/${push.root}/${cgapp.toolchain}">
<fileset dir="${env.PUSH_TOOLCHAIN}" includes="**"/>
</copy>
....
</target>
</..>
while running the ant build the ANT_OPTS has been setup to -Xmx4g and the ant scripts works fine. but when i run the maven package command it throws an error as shown below.
An Ant BuildException has occured: java.lang.OutOfMemoryError: Java heap space
I believe that the maven plugin doesnt read the ANT_OPTS env variable but rather has a default value. Does any one know why this is happening and if there a way to pass in ANT_OPTS variable to antrun plugin ?