0
votes

I do not thave the experiance in gwt and migrating one of the gwt project ant to maven for devops migration.

in ant build it is working fine.

but when i use maven with gwt-maven-plugin to generate the code getting below error.

[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

this is the sampe structure

enter image description here

main module 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

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

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

1 Answers

0
votes

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:

<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).

Consider adding some configuration to your gwt.xml main file, for example:

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