Version 2 (modified by nigel.sim, 9 months ago)

--

Starting JMX for Tomcat under Maven

As I run most of my development webservers using Maven's Tomcat plugin, I also need to have the JMX service running so I can develop the MBeans. Attempts to simply put the -D commands on the Maven command line failed, but putting them in the MAVEN_OPTS variable worked, so:

export MAVEN_OPTS="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=18080 -Dcom.sun.management.jmxremote.authenticate=false -Djava.net.preferIPv4Stack=true"
MAVEN_OPTS="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=18080 -Dcom.sun.management.jmxremote.authenticate=false -Djava.net.preferIPv4Stack=true" mvn -Dmaven.tomcat.port=8180 tomcat:run