mvn tomcat7:run - How to add properties

561 views Asked by At

How can I add jvm properties?

for example I wish to add the following

" -Dcom.sun.management.jmxremote.port=8004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "

1

There are 1 answers

2
Kai On

Try setting the JVM properties on the MAVEN_OPTS environment variable, i.e. on Linux

export MAVEN_OPTS="-Dcom.sun.management.jmxremote.port=8004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

or on Windows create a new environment variable with name MAVEN_OPTS and the JVM properties as value.

If you run maven from the command line on windows you can also set the MAVEN_OPTS temporarily using the command

set MAVEN_OPTS="-Dcom.sun.management.jmxremote.port=8004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"