Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to pass JVM args via command line to Maven? [duplicate]

Tags:

java

maven

jetty

People also ask

How set VM argument in Maven?

Using the Maven Compiler Plugin configuration for compiling application code and test code, you can set the required Xmx, Xms, Xss options via the compileArgs configuration entry, available for both compile and testCompile goals. An official example is available here and on other SO answers like this one.

How do I change JVM arguments?

Yes, right click the project. Click Run as then Run Configurations . You can change the parameters passed to the JVM in the Arguments tab in the VM Arguments box. That configuration can then be used as the default when running the project.

What is Maven_opts?

MAVEN_OPTS is an environment variable used by the shell scripts that launch the Java Virtual Machine (JVM) that runs Maven. Using MAVEN_OPTS you can pass options to the JVM when it's launched.


I think MAVEN_OPTS would be most appropriate for you. See here: http://maven.apache.org/configure.html

In Unix:

Add the MAVEN_OPTS environment variable to specify JVM properties, e.g. export MAVEN_OPTS="-Xms256m -Xmx512m". This environment variable can be used to supply extra options to Maven.

In Win, you need to set environment variable via the dialogue box

Add ... environment variable by opening up the system properties (WinKey + Pause),... In the same dialog, add the MAVEN_OPTS environment variable in the user variables to specify JVM properties, e.g. the value -Xms256m -Xmx512m. This environment variable can be used to supply extra options to Maven.