简体   繁体   English

从Maven运行gwt-IntelliJ

[英]Run gwt from maven - IntelliJ

When trying to run gwt:run from IntelliJ Maven projects panel, this is what I get: 当尝试从IntelliJ Maven项目面板运行gwt:run时,这是我得到的:

[WARNING] GWT plugin is configured to detect modules, but none were found.
[ERROR] Missing required argument 'module[s]'
[ERROR] Google Web Toolkit 2.4.0
[ERROR] DevMode [-noserver] [-port port-number | "auto"] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logdir directory] [-logLevel level] [-gen dir] [-bindAddress host-name-or-address] [-codeServerPort port-number | "auto"] [-server servletContainerLauncher[:args]] [-startupUrl url] [-war dir] [-deploy dir] [-extra dir] [-workDir dir] module[s] 
[ERROR] 

What is the work around for this for IntelliJ? IntelliJ的解决方法是什么?

Please take a look at this page: 请看一下这个页面:

http://mojo.codehaus.org/gwt-maven-plugin/run-mojo.html http://mojo.codehaus.org/gwt-maven-plugin/run-mojo.html

There you can find all properties you can set for you gwt:run target. 在这里,您可以找到可以为gwt:run目标设置的所有属性。

This is how you define the module in you pom.xml: 这是在pom.xml中定义模块的方式:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <version>${gwtVersion}</version>
    <dependencies>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwtVersion}</version>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-dev</artifactId>
            <version>${gwtVersion}</version>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
            </goals>
            <configuration>
                <runTarget>index.html</runTarget>
                <modules>
                    <module>com.yourcompany.YourModule</module>
                </modules>
                <logLevel>INFO</logLevel>
                <failOnError>true</failOnError>
                <closureCompiler>true</closureCompiler>
                <extraJvmArgs>-Xms512m -Xmx8g -XX:MaxPermSize=512m</extraJvmArgs>
                <localWorkers>8</localWorkers>
                <copyWebapp>true</copyWebapp>
                <gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>
                <!-- and so on... take a look at the plugin page for more options -->
            </configuration>
        </execution>
    </executions>
</plugin>

By the way, you should use the latest GWT and GWT Maven Plugin (currently 2.7.0). 顺便说一句,您应该使用最新的GWT和GWT Maven插件(当前为2.7.0)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM