簡體   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