繁体   English   中英

GWT WebApp 查找入口点

[英]GWT WebApp finding entry point

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

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

client.gwt.xml,来自我的 gwt-module。它实现了视图、演示者、入口点

<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,来自我的 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 网页

        <!-- 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

暂无
暂无

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

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