tbroyer / gwt-maven-plugin

Starting fresh on building GWT projects with Maven
https://tbroyer.github.io/gwt-maven-plugin/
Apache License 2.0
167 stars 39 forks source link

[Question] How can i activate the debug logging ? because i keep getting the error: Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly #163

Closed p4535992 closed 7 months ago

p4535992 commented 7 months ago

I run this command gwt:generate-module compile gwt:devmode on my project . but i keep getting this error without really understanding what the problem is

[DEBUG] Arguments: com.google.gwt.dev.DevMode -workDir D:\myproject\target\gwt\devmode\work -sourceLevel 11 -war D:\myproject\target\gwt\devmode\war -noserver -codeServerPort 45300 xxx.myproject.client.DesktopApp
[INFO] Super Dev Mode starting up
[INFO]    workDir: D:\myproject\target\gwt\devmode\work
[WARNING] 2023-11-13 19:05:07.197:INFO::main: Logging initialized @3220ms
[INFO]    Loading Java files in xxx.myproject.client.DesktopApp.
[INFO]    Finding entry point classes
[INFO]       [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:10 min
[INFO] Finished at: 2023-11-13T19:05:26+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.ltgt.gwt.maven:gwt-maven-plugin:1.1.0:devmode (default-cli) on project myproject: GWT exited with status 1 -> [Help 1]

- org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.ltgt.gwt.maven:gwt-maven-plugin:1.1.0:devmode (default-cli) on project myproject: GWT exited with status 1

    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:347)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:827)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:272)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:195)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: GWT exited with status 1
    at net.ltgt.gwt.maven.CommandLine.execute(CommandLine.java:73)
    at net.ltgt.gwt.maven.AbstractDevModeMojo.execute(AbstractDevModeMojo.java:272)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:342)
    ... 25 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Is there any parameter I can enable to display more details about the error ?

Here the properties:

<properties>
        <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
        <gwt.version>2.9.0</gwt.version>
        <gxt.version>4.1.0</gxt.version>
                <gwt-maven-plugin.version>1.1.0</gwt-maven-plugin.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>11</java.version>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>

Here the src/main/module.gwt.xml

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

    <inherits name='com.sencha.gxt.ui.GXT'/>
    <inherits name="com.sencha.gxt.theme.blue.Blue" />

    <entry-point class=xxx.myproject.client.DesktopApp' />

    <source path='client' />
    <source path='shared' />
    <source path='esb/mail/client' />
    <source path='pacompliance/client' />
    <source path='filingclass/client' />
    <source path='protocollo/client' />
    <source path='conservazione/client' />
    <set-configuration-property name="xsiframe.failIfScriptTag" value="FALSE"/>
    <set-property name="user.agent" value="safari" />
    <set-property name="gxt.user.agent" value="chrome" />
    <set-property name="gxt.device" value="desktop" />
    <set-property name="compiler.useSourceMaps" value="true" /> 

</module>

Here the plugin pom:

<plugin>
    <groupId>net.ltgt.gwt.maven</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <version>${gwt-maven-plugin.version}</version>
    <extensions>true</extensions> 
    <configuration>
        <skipModule>false</skipModule>
        <classpathScope>compile</classpathScope>
        <moduleName>xxx.myproject.client.DesktopApp</moduleName>
        <!--<moduleShortName>myproject</moduleShortName>-->                     
        <devmodeArgs>
            <arg>-noserver</arg>
            <arg>-codeServerPort</arg>
            <arg>45300</arg>
        </devmodeArgs>
    </configuration>
</plugin>
tbroyer commented 7 months ago

You can "just" use Maven debug logs (mvn -X …), or set the logLevel property, either in your POM or from the command-line as -Dgwt.logLevel=DEBUG https://tbroyer.github.io/gwt-maven-plugin/devmode-mojo.html#logLevel

BTW, you may want to use gwt:codeserver with launcherDir rather than gwt:devmode with -noserver.

p4535992 commented 7 months ago

Ty i'll try that

p4535992 commented 7 months ago

Nothing no information regarding the cause of the error if i delete the module.gwt.xml file instead it starts without any problems...

mvn -X e -Dgwt.logLevel=DEBUG gwt:generate-module compile gwt:devmode logs.txt

tbroyer commented 7 months ago

Ah! Your moduleName is xxx.myproject.client.DesktopApp which means the module.gwt.xml will end up at xxx/myproject/client/DesktopApp.gwt.xml, and it includes <source path="client"/> which means your Java sources need to be in package xxx.myproject.client.client. This excludes the entrypoint class xxx.myproject.client.DesktopApp.

I would rename the moduleName to xxx.myproject.DesktopApp (make sure to also update the <script src=""> in your HTML host page).

p4535992 commented 7 months ago

Sorry for delay. it was that ! ty very much. Really appreciate the fast response