Jim, Using the systemProperties configuration for the plugin means that they cannot be set until the plugin runs - for some types of system properties that's simply too late and they have to be set at the time the jvm starts. Try using MAVEN_OPTS environment variable instead.
Jan On 30 June 2014 19:58, Jim Garrison <[email protected]> wrote: > I'm trying to set system properties to enable JMX (the > com.sun.management.jmxremote.* properties) but when I run > > mvn jetty:run > > JMX does not get enabled (nothing listening on port 1099). Here's my plugin > configuration (${jetty.version} = 9.1.0.v20131115) > > <plugin> > <groupId>org.eclipse.jetty</groupId> > <artifactId>jetty-maven-plugin</artifactId> > <version>${jetty.version}</version> > <configuration> > <stopPort>9967</stopPort> > <stopKey>password</stopKey> > <webApp> > <contextPath>/</contextPath> > </webApp> > <systemProperties> > > <systemProperty><name>com.sun.management.jmxremote</name><value></value></systemProperty> > > <systemProperty><name>com.sun.management.jmxremote.ssl</name><value>false</value></systemProperty> > > <systemProperty><name>com.sun.management.jmxremote.authenticate</name><value>false</value></systemProperty> > > <systemProperty><name>com.sun.management.jmxremote.port</name><value>1099</value></systemProperty> > </systemProperties> > </configuration> > </plugin> > > I ran Maven with the -X option and the debug log appears to show that the > properties are being set correctly (see below). Obviously I'm missing > something simple... any ideas? > > ... > > [DEBUG] > ----------------------------------------------------------------------- > [DEBUG] Goal: > org.eclipse.jetty:jetty-maven-plugin:9.1.0.v20131115:run (default-cli) > [DEBUG] Style: Regular > [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?> > <configuration> > <classesDirectory>${project.build.outputDirectory}</classesDirectory> > <daemon default-value="false">${jetty.daemon}</daemon> > <execution>${mojoExecution}</execution> > <pluginArtifacts>${plugin.artifacts}</pluginArtifacts> > <project>${project}</project> > <projectArtifacts>${project.artifacts}</projectArtifacts> > <reload default-value="automatic">${jetty.reload}</reload> > <scanIntervalSeconds > default-value="0">${jetty.scanIntervalSeconds}</scanIntervalSeconds> > <skip default-value="false">${jetty.skip}</skip> > <stopKey>password</stopKey> > <stopPort>9967</stopPort> > <systemProperties> > <systemProperty> > <name>com.sun.management.jmxremote</name> > <value></value> > </systemProperty> > <systemProperty> > <name>com.sun.management.jmxremote.ssl</name> > <value>false</value> > </systemProperty> > <systemProperty> > <name>com.sun.management.jmxremote.authenticate</name> > <value>false</value> > </systemProperty> > <systemProperty> > <name>com.sun.management.jmxremote.port</name> > <value>1099</value> > </systemProperty> > </systemProperties> > <systemPropertiesFile>${jetty.systemPropertiesFile}</systemPropertiesFile> > > <testClassesDirectory>${project.build.testOutputDirectory}</testClassesDirectory> > <useProvidedScope default-value="false"/> > <useTestScope default-value="false"/> > <webApp> > <contextPath>/</contextPath> > </webApp> > <webAppSourceDirectory>${maven.war.src}</webAppSourceDirectory> > <webXml>${maven.war.webxml}</webXml> > </configuration> > > ... > > [DEBUG] Configuring mojo > org.eclipse.jetty:jetty-maven-plugin:9.1.0.v20131115:run from plugin realm > ClassRealm[plugin>org.eclipse.jetty:jetty-maven-plugin:9.1.0.v20131115, > parent: sun.misc.Launcher$AppClas > sLoader@749cd006] > > ... > > [DEBUG] (s) name = com.sun.management.jmxremote > [DEBUG] (s) systemProperty = > org.eclipse.jetty.maven.plugin.SystemProperty@45fda6a8 > [DEBUG] (s) name = com.sun.management.jmxremote.ssl > [DEBUG] (s) value = false > [DEBUG] (s) systemProperty = > org.eclipse.jetty.maven.plugin.SystemProperty@fc8837e > [DEBUG] (s) name = com.sun.management.jmxremote.authenticate > [DEBUG] (s) value = false > [DEBUG] (s) systemProperty = > org.eclipse.jetty.maven.plugin.SystemProperty@3530cd4a > [DEBUG] (s) name = com.sun.management.jmxremote.port > [DEBUG] (s) value = 1099 > [DEBUG] (s) systemProperty = > org.eclipse.jetty.maven.plugin.SystemProperty@16f5d08e > [DEBUG] (s) systemProperties = > org.eclipse.jetty.maven.plugin.SystemProperties@644f2668 > [DEBUG] (f) testClassesDirectory = > C:\dev\git\etl3\etl-server\target\test-classes > [DEBUG] (f) useProvidedScope = false > [DEBUG] (f) useTestScope = false > [DEBUG] (s) contextPath = / > [DEBUG] (f) webApp = o.e.j.m.p.JettyWebAppContext@7a8eb36a{/,null,null} > [DEBUG] -- end configuration -- > [INFO] Configuring Jetty for project: etl-server > [INFO] webAppSourceDirectory not set. Trying src\main\webapp > [INFO] Reload Mechanic: automatic > [INFO] Classes = C:\dev\git\etl3\etl-server\target\classes > [DEBUG] Starting Jetty Server ... > [DEBUG] Property com.sun.management.jmxremote.port=1099 was set > [DEBUG] Property com.sun.management.jmxremote.ssl=false was set > [DEBUG] Property com.sun.management.jmxremote=null was set > [DEBUG] Property com.sun.management.jmxremote.authenticate=false was set > [INFO] Context path = / > [INFO] Tmp directory = C:\dev\git\etl3\etl-server\target\tmp > [INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml > [INFO] Web overrides = none > _______________________________________________ > jetty-users mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/jetty-users -- Jan Bartel <[email protected]> www.webtide.com 'Expert Jetty/CometD developer,production,operations advice' _______________________________________________ jetty-users mailing list [email protected] To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/jetty-users
