gwt-maven-plugin:如何在pom.xml中为gwt:run目标设置系统属性?

Jim*_*ing 4 gwt maven-2

我正在尝试在使用的托管模式下运行的GWT应用程序上设置系统属性mvn gwt:run.从事物的外观来看,这个属性并没有被设定.在我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>
Run Code Online (Sandbox Code Playgroud)

Val*_*s R 10

请参阅gwt-maven-plugin的编译指南.您可以使用该extraJvmArgs元素.

  <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>
Run Code Online (Sandbox Code Playgroud)

编辑:事实证明这不适用于gwt:run goal,但将extraJvmArgs移动到插件(而不是执行)配置中:

  <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>
Run Code Online (Sandbox Code Playgroud)