Increase memory of tomcat7 maven plugin?

前端 未结 3 1448
长发绾君心
长发绾君心 2020-12-10 10:43

I want to start an embedded tomcat7 instance directly from maven using the tomcat7-maven-plugin. This is working fine, but the Tomcat started doesn\'t seem to have enough me

相关标签:
3条回答
  • 2020-12-10 10:51

    You can set the properties in this way

    <configuration>
      <systemProperties>
        <JAVA_OPTS>-Xms256m -Xmx512m -XX:MaxPermSize=256m</JAVA_OPTS>
      </systemProperties>
    </configuration>
    
    0 讨论(0)
  • 2020-12-10 11:05

    This one worked for me:

    <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <version>...</version>
        <configuration>
            <container>...</container>
            <configuration>
                <type>standalone</type>
                <home>...</home>
                <properties>
                    <cargo.jvmargs>-Xmx4096m</cargo.jvmargs>
                </properties>
            </configuration>
            <deployables>...</deployables>
        </configuration>
    </plugin>
    

    It starts up my tomcat8 in a new JVM with argument "-Xmx4096m".

    0 讨论(0)
  • 2020-12-10 11:08

    As most said in the comments above the properties in pom.xml has no effct. What worked for me was setting my MAVEN_OPTS

    MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"
    

    Or on Windows in a cmd terminal:

    set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=256m
    

    For mac/linux users, just add an export statement to your ~/.profile (or similar file name). For example:

    export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"
    

    And restart your shell.

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