Increase heap size in m2e Eclipse plugin

前端 未结 5 1795
无人及你
无人及你 2020-12-30 03:58

How does one increase the heap size of the m2e Eclipse plugin? Basically, I\'m trying to run an automated integration test using Cargo and Selenium under STS (SpringSource\'

相关标签:
5条回答
  • 2020-12-30 04:36

    You can add in your pom.xml your memory settings:

    <plugin>
     <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        ...
        <fork>true</fork>
        <meminitial>128m</meminitial>
        <maxmem>512m</maxmem>
        ...
      </configuration>
    </plugin>
    

    The description of all maven-compiler-plugin parameters is here: link

    0 讨论(0)
  • 2020-12-30 04:36

    I've faced a similar issue. Create a file named mavenrc_pre.bat on windows or .mavenrc on linux in your home folder and set your maven_opts as you wish in it. It is working with m2e bundled with Eclipse Indigo.

    0 讨论(0)
  • 2020-12-30 04:40

    Have you tried setting the MAVEN_OPTS environment variable for your run configuration?

    MAVEN_OPTS="-Xmx768M -XX:MaxPermSize=128m" 
    

    Might be you'll have to edit your system environment variables if setting it in the run configuration doesn't help. See here or here

    0 讨论(0)
  • 2020-12-30 04:42

    When working with the Maven 2 plugin, setting java options in eclipse.ini or MAVEN_OPTS environment variable will have no effect on your build. You need to add some command line args via the "Edit Configuration and launch" dialog in Eclipse.

    "Run As" > "Maven Build", click on the "JRE" tab, enter VM args e.g.

    -Xms128M -Xmx512M

    0 讨论(0)
  • 2020-12-30 04:47

    As a follow-on to the already accepted answer, when you invoke "mvn" on the command-line, you are really invoking the mvn.bat (or mvn.sh) wrapper script. It is this wrapper script that uses the MAVEN_OPTS env variable when kicking off the actual maven jvm.

    m2e, on the other hand, wants more control over how the maven jvm is kicked off, so it does this directly without the wrapper. This is why you add your memory settings directly to your m2e run/debug configuration VM arguments, rather than using MAVEN_OPTS.

    If you want m2e to pass what you already have in MAVEN_OPTS to the maven jvm, in the "Edit Configuration and launch" dialog in Eclipse:

    "Run As" > "Maven Build", click on the "JRE" tab, enter VM args e.g.

    ${env_var:MAVEN_OPTS}
    
    0 讨论(0)
提交回复
热议问题