Search code examples
mavenout-of-memorymaven-pluginmaven-invoker-plugin

when call projects poms using maven-invoker-plugin it throws OutOfMemoryException


I got a multi project setup , which requires to be invoke using one root project pom.

When run each project separately all works fine, Tests executed successfully , BUT when projects been invoked using maven-invoker-plugin all projects failed with OtOfMemory upon start executing the Testing .

MAVEN_OPTS are -Xmx2048m , Java 8 Linux env


Solution

  • maven-surefire-plugin spins a new JVM by default, MAVEN_OPTS you set are not applicable for this or not passed.

    Please do as below.

    Use argLine parameter as below. http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#argLine

    probably you might have memory leak which is causing this , use Eclipse Memory Analyser to debug which should fix your issue.