【问题标题】:Running a Modular GWT in DevMode在 DevMode 中运行模块化 GWT
【发布时间】:2014-08-22 23:05:08
【问题描述】:

我最近使用 maven 原型模块 webapp (https://github.com/tbroyer/gwt-maven-archetypes) 将我的 GWT 应用程序从单个项目更改为模块化项目。虽然使用 SuperDevMode 时一切正常,但我无法让旧的 DevMode 与新结构一起工作。我想再次使用旧的 DevMode 的项目,因为我感觉更熟悉 eclipse 中的调试。

我按照模块化webapp原型的howto中提供的步骤:

  1. mvn clean install -Dgwt.compiler.skip
  2. 在一个终端窗口中:cd *-client && mvn gwt:run -Ddev
  3. 在另一个终端窗口中:mvn tomcat7:run -Ddev

所有步骤似乎都成功了,尽管第 2 步中出现警告:

[WARNING] Your POM <build><outputdirectory> does not match your hosted webapp WEB-INF/classes folder for GWT Hosted browser to see your classes.

但是当我从 GWT 窗口打开浏览器时,我只是得到一个空白页面。所以也许 gwt-maven-plugin 配置有问题:

<properties>
    <gwt.genParam>false</gwt.genParam>
    <!-- keep in sync with *-server -->
    <runTarget>http://localhost:8080</runTarget>
</properties>
<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <configuration>
                <module>testproject.Project</module>
                <strict>true</strict>
                <genParam>${gwt.genParam}</genParam>
                <noserver>true</noserver>
                <runTarget>${runTarget}</runTarget>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
                <packagingExcludes>WEB-INF/**</packagingExcludes>
            </configuration>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat6-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

【问题讨论】:

  • 浏览器开发工具有错误吗? (它是否找到 nocache.js 开头?)
  • 谢谢你的提示,你是对的。
  • 顺便说一句,[WARNING] Your POM &lt;build&gt;&lt;outputdirectory&gt; does not match your hosted webapp WEB-INF/classes folder for GWT Hosted browser to see your classes. 来自 gwt-maven-plugin 并告诉您 DevMode 不会看到您的服务器端类,如果它们发生变化,但您不在乎,因为 DevMode 只运行项目的客户端。

标签: java maven gwt


【解决方案1】:

浏览器找不到 nocache.js,这是由于 maven 配置文件的参数中的拼写错误造成的。我使用 -PDev 而不是 -Pdev。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-29
    • 1970-01-01
    • 1970-01-01
    • 2011-11-28
    • 1970-01-01
    • 2012-09-02
    • 2012-11-29
    相关资源
    最近更新 更多