I am getting StackOverflowError while building my project like - The system is out of resources. Consult the following stack trace for details.
java.lang.StackOverflowError
    at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:625)
When i increased maven memory from terminal like export MAVEN_OPTS="-Xms1024m -Xmx1024m -XX:PermSize=1024m -XX:MaxPermSize=1024m -Xss1024m" It's working but i need to do same from pom file as build is failing in jenkins too. I am using spring boot maven plugin, i tried many things like below but its not working. Please help. Tried solutions in maven plugin -
 <jvmArguments>
                    -XX:PermSize=1024m
                    -XX:MaxPermSize=1024m
                    -Xss1024m
                </jvmArguments>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <executable>true</executable>
        <fork>true</fork>
        <meminitial>128m</meminitial>
        <maxmem>512m</maxmem>
        <compilerArgument>-verbose -bootclasspath ${java.home}\lib\rt.jar</compilerArgument>
    </configuration>
</plugin>