本文介绍了如何控制maven-jetty-plugin的VM参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置Jetty的VM参数从maven-jetty-plugin运行?

How to set VM arguments for Jetty run from maven-jetty-plugin?

例如,我需要传递 -Xmx Jetty运行的参数由 mvn jetty:run 命令运行。

For example, I need to pass -Xmx arguments to Jetty run by the mvn jetty:run command.

推荐答案

环境变量MAVEN_OPTS 就是答案。 MAVEN_OPTS的字符串内容传递给JVM(java.exe)。

The enviroment variable MAVEN_OPTS is the answer. The string content of MAVEN_OPTS is passed to JVM (java.exe).


  • Linux:在shell类型 export MAVEN_OPTS = ....

  • Windows:在shell(cmd.exe)中输入设置MAVEN_OPTS = ...

  • Linux: in shell type export MAVEN_OPTS=....
  • Windows: in shell (cmd.exe) type set MAVEN_OPTS=...

例如:在Windows上设置MAVEN_OPTS = - Xmx1024m将Maven进程的堆大小设置为1024mb。

For example: on Windows set MAVEN_OPTS="-Xmx1024m" sets the heap size of the Maven process to 1024mb.

更新(01.04.2013):直接将其传递给Jetty。

Update (01.04.2013): Pass it directly to Jetty.

Matthew Farwell(请点击给予他信任)附带解决方案使用分叉的JVM进程来运行Jetty,这是。这是一个更好的解决方案,因为前者在与Maven相同的JVM进程内运行(因此共享内存)。

Matthew Farwell (please upvote his answer to give him credit) comes with the solution of using a forked JVM process to run Jetty which is a new feature of the Jetty plugin. This is a better solution as the former runs inside same JVM process as Maven (thus shares memory).

这篇关于如何控制maven-jetty-plugin的VM参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 08:17