How to set -XX:PermSize=64m in maven-compiler-plugin?

前端 未结 3 1652
梦谈多话
梦谈多话 2020-12-21 08:48

I faild in setting the permsize or maxpermsize with the maven-compiler-plugin (v3.2).

I tried it like this:


org.apache         


        
相关标签:
3条回答
  • 2020-12-21 09:01

    First there is a hint concerning the parameters in the docs

    Sets the arguments to be passed to the compiler if fork is set to true. Example:

    <compilerArgs>
      <arg>-Xmaxerrs=1000</arg>
      <arg>-XX:PermSize=128m</arg>
    </compilerArgs>
    

    which means if you need them for you build you have to do this either via MAVEN_OPTS or you can define them in .mavenrc (linux) or mavenrc_pre.bat (Windows).

    0 讨论(0)
  • 2020-12-21 09:03

    From the javac documentation:

    -Joption Pass option to the java launcher called by javac. For example, -J-Xms48m sets the startup memory to 48 megabytes.

    Based on the above:

    <compilerArgs>
      <arg>-J-XX:PermSize=128m</arg>
      <arg>-J-XX:MaxPermSize=256m</arg>
    </compilerArgs>
    
    0 讨论(0)
  • 2020-12-21 09:17

    You can just add

    export MAVEN_OPTS=-Xmx512m

    in your ~/.bash_profile

    0 讨论(0)
提交回复
热议问题