Is there a way to pass jvm args via command line to maven?

Possible duplicate:
Maven jetty plugin - how to manage vm arguments?

In particular, I want to do something like this:

mvn -DjvmArgs="-Xmx2000m -Xms1000m -XX:PermSize=512m -XX:MaxPermSize=512m" jetty:run -Pmyprofile 

Oh, and I would like to do this without having to modify the pom files or set any environment variables .. etc

+79
java maven jetty
Sep 21 '12 at 6:25
source share
1 answer

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

On Unix:

Add the MAVEN_OPTS environment variable to specify JVM properties, for example. export MAVEN_OPTS="-Xms256m -Xmx512m" . This environment variable can be used to provide additional Maven options.

In Win, you need to set the environment variable through the dialog box

Add an environment variable by opening the system properties ( WinKey + Pause ), ... In the same dialog box, add the MAVEN_OPTS environment MAVEN_OPTS to user variables to specify JVM properties, for example. value -Xms256m -Xmx512m . This environment variable can be used to provide additional Maven options.

+85
Sep 21 '12 at 6:32
source share



All Articles