gwt-maven-plugin:如何在 pom.xml 中设置 gwt:run 目标的系统属性?
我正在尝试在使用 mvn gwt:run
启动的托管模式下运行的 GWT 应用程序上设置系统属性。从表面上看,该房产尚未确定。在我的 pom.xml
中,插件配置是:-
<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>
I'm trying to set a system property on a GWT application running in hosted mode launched using mvn gwt:run
. The property isn't getting set, by the looks of things. In my pom.xml
the plugin configuration is: -
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅 gwt-maven-plugin 的编译指南。您可以使用
extraJvmArgs
元素。编辑:事实证明,这对 gwt:run 目标不起作用,但将 extraJvmArgs 移动到插件(而不是执行)配置中确实如此:-
See Compile Guide for gwt-maven-plugin. You can use the
extraJvmArgs
element.Edit: This turned out not to work for the
gwt:run goal
, but moving the extraJvmArgs into the plugin (rather than execution) configuration did: -systemProperties 不是属性,而是一个映射,
如下使用:
systemProperties are not properties but a map
Use it like this :