java - GWT WebApp 寻找入口点

标签 java google-app-engine maven gwt

我有一个包含 3 个模块的 Maven 项目:api、gwt、web。

Web 模块创建了 war 文件,现在我有 2 个 gwt.xml 文件

client.gwt.xml,来 self 的 gwt-module。它实现了 View 、演示者、入口点

<module>

    <!-- Inherit the core Web Toolkit stuff. -->
    <inherits name='com.google.gwt.user.User' />
    <inherits name='org.fusesource.restygwt.RestyGWT' />

    <!--Specify the app entry point class. -->
    <entry-point class='com.myapp.admin.client.EntryPoint'/>    

    <source path='rest'/>
    <source path='client'/>
    <source path='consts'/>

</module>

和 web.gwt.xml,来 self 的 Web 模块,应用程序应部署在其中。它继承了 gwt 模块,您可以看到 com.myapp.admin.client。

<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />

<inherits name='com.myapp.admin.client' /> 

我还在 pom.xml 中添加了该模块的依赖项。但我缺少一些继承,因为:

Compiling module com.myapp.admin.web
   Finding entry point classes
      [ERROR] Unable to find type 'com.myapp.admin.client.EntryPoint
         [ERROR] Hint: Check that the type name 'com.myapp.admin.client.EntryPoint'
         [ERROR] Hint: Check that your classpath includes all required source roots

我可以跟踪跟踪,并且理解为什么 com.myapp.admin.client 中没有类路径,因为当我构建模块时,仅构建 Web 模块中的类。但我认为有了依赖和继承就足够了。感谢您的帮助。

编辑:POM.xml WEB

        <!-- GWT Maven Plugin -->
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <executions>
            <execution>
                <goals>
                    <goal>compile</goal>
                </goals>
            </execution>
        </executions>
        <configuration>

    </plugin>


    <!-- Copy static web files before executing gwt:run -->
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
    </plugin>

POM.xml 客户端

<build>
<plugins>
    <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
            <execution>
                <id>attach-sources</id>
                <phase>verify</phase>
                <goals>
                    <goal>jar-no-fork</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
</plugins>

最佳答案

我敢打赌,您的 client jar 不包含 *.java 源文件。 GWT 需要编译的类和源文件(主要是源文件)。

参见http://mojo.codehaus.org/gwt-maven-plugin/user-guide/library.html

关于java - GWT WebApp 寻找入口点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22835563/

相关文章:

java - 共享Memcache能保证列表的顺序吗?

google-app-engine - app.yaml api_version 将 Google AppEngine 从 Go 1.9 迁移到 Go 1.11 时出现问题

java - 编译后的 Eclipse maven 在 Eclipse 中看不到目标/类文件夹

maven - 如何从同一个项目生成两个 Sonar 报告?

java - Vaadin -> Vaadin GWT 聚合物元素集成

java - 使用 Jersey 通过 Struts 2 框架将文件下载为输入流?

java - 在 java 中使用 Oauth 保护 Rest API

java - Google App Engine (Java) 中的 RSS 解析器

java - 如何在 JAVA 中将两个 int(s) 合并为一个 double?

java - JFileChooser/FileWriter 不允许我保存在 C : disk 的根目录中