简体   繁体   English

GWT包结构问题-模块未定义入口点

[英]GWT Package structure issue - Module has no entry points defined

I do not thave the experiance in gwt and migrating one of the gwt project ant to maven for devops migration. 我不了解gwt的经验,也没有将其中一种gwt项目蚂蚁迁移到行家以进行devops迁移。

in ant build it is working fine. 在蚂蚁建立它工作正常。

but when i use maven with gwt-maven-plugin to generate the code getting below error. 但是当我使用带有gwt-maven-plugin的maven来生成低于错误​​的代码。

[DEBUG] Found class:class com.google.gwt.dev.GWTCompile [INFO] Compile GWT module com.companyname.projectname.branch.gwt.Dto [DEBUG] invoke GWTCompiler#main(String[]) [ERROR] Module has no entry points defined [ERROR] Build failed [DEBUG]找到了类:类com.google.gwt.dev.GWTCompile [INFO]编译GWT模块com.companyname.projectname.branch.gwt.Dto [DEBUG] invoke GWTCompiler#main(String [])[ERROR]模块具有没有定义入口点[错误]构建失败

this is the sampe structure 这是样本结构

在此处输入图片说明

main module xml 主模块xml

<module>
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.i18n.I18N' />
<inherits name='com.google.gwt.http.HTTP' />
<inherits name='com.companyname.projectname.branch.gwt.Dto' />
<inherits name='com.companyname.projectname.commons.Commons' />


<servlet path="/projectnamePLServicesImpl"
    class="com.companyname.projectname.pr.gwt.server.projectnamePLServicesImpl" />

<entry-point class='com.companyname.projectname.ui.gwt.client.MainModule' />

dto xml DTO XML

<?xml version="1.0" encoding="UTF-8"?>
<module>
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.i18n.I18N' />
</module>

and maven plugin 和Maven插件

            <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
              <version>1.0</version>
              <configuration>
                <moduleName>com.companyname.projectname.ui.gwt.client.MainModule</moduleName>


                <!-- <logLevel></logLevel> -->
                </configuration>
                <executions>
      <execution>

        <goals>
          <goal>compile</goal>
        </goals>
      </execution>
    </executions>

As far as I see, your main module gwt.xml file is placed inside the com.companyname.projectname.ui.gwt package, so your configuration for the GWT Maven plugin has to be the following: 据我所知,您的主模块gwt.xml文件位于com.companyname.projectname.ui.gwt包内,因此您对GWT Maven插件的配置必须如下:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <version>2.8.0</version>
    <configuration>
        <module>com.companyname.projectname.ui.gwt.MainModule</module>
        <!-- <logLevel></logLevel> -->
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>compile</goal>
        </goals>
      </execution>
    </executions>
</plugin>

Also I advise you to use the same version of the gwt-maven-plugin used for your GWT artifacts (for example, if you use GWT 2.8.0, you can use the 2.8.0 version of GWT plugin). 另外,我建议您使用与GWT工件相同的gwt-maven-plugin版本(例如,如果使用GWT 2.8.0,则可以使用2.8.0版本的GWT插件)。

Consider adding some configuration to your gwt.xml main file, for example: 考虑将一些配置添加到您的gwt.xml主文件中,例如:

<module>
    <inherits name='com.google.gwt.user.User' />
    <inherits name='com.google.gwt.i18n.I18N' />
    <inherits name='com.google.gwt.http.HTTP' />
    <inherits name='com.companyname.projectname.branch.gwt.Dto' />
    <inherits name='com.companyname.projectname.commons.Commons' />


    <!--servlet path="/uploadServlet"      class="com.companyname.rsa.gwt.demo.server.UploadServlet"/-->

    <servlet path="/projectnamePLServicesImpl"
class="com.companyname.projectname.pr.gwt.server.projectnamePLServicesImpl" />

    <source path='client'/>

    <entry-point class='com.companyname.projectname.ui.gwt.client.MainModule' />
</module>

The 'source' tag will tell the GWT compiler where to look for the Java classes to translate into JavaScript, so that make your entry point class accessible. “ source”标签将告诉GWT编译器在哪里寻找将Java类转换为JavaScript的位置,从而使您的入口点类可访问。

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

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