Gwt-maven-plugin: How to set system properties for gwt: run target in pom.xml?

I am trying to set a system property in a GWT application running in host mode launched using mvn gwt:run . The property does not receive the established appearance. In my pom.xml plugin configuration: -

 <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.2.0</version> <executions> <execution> <configuration> <module>com.foo</module> </configuration> <goals> <goal>compile</goal> <goal>test</goal> </goals> </execution> </executions> <configuration> <runTarget>index.html</runTarget> <hostedWebapp>${webappDirectory}</hostedWebapp> <systemProperties> <property> <name>configDir</name> <value>${basedir}/local/staging</value> </property> </systemProperties> </configuration> </plugin> 
+4
source share
2 answers

See the compilation guide for gwt-maven-plugin. You can use the extraJvmArgs element.

  <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.2.0</version> <executions> <execution> <configuration> <extraJvmArgs>-Xmx512M -Xss1024k -Dfoo=bar</extraJvmArgs> </configuration> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin> 

Edit: this turned out not to work for gwt:run goal , but moving extraJvmArgs to the plugin configuration (and not execution): -

  <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.2.0</version> <configuration> <extraJvmArgs>-Xmx512M -Xss1024k -Dfoo=bar</extraJvmArgs> </configuration> </plugin> 
+10
source

systemProperties are not properties, but a map

Use it as follows:

 <systemProperties> <configDir>${basedir}/local/staging</configDir> </systemProperties> 
+2
source

All Articles