How to set VM arguments for Jetty run from maven-jetty-plugin?
For example, I need to pass -Xmx arguments to Jetty run by the mvn jetty:run command.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The enviroment variable MAVEN_OPTS is the answer. The string content of MAVEN_OPTS is passed to JVM (java.exe).
export MAVEN_OPTS=....set MAVEN_OPTS=...For example: on Windows
set MAVEN_OPTS="-Xmx1024m"sets the heap size of the Maven process to 1024mb.Update (01.04.2013): Pass it directly to Jetty.
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).