2

I am having problems with getting the gwt-maven-plugin working as the docs have stated. using GWT 2.8.2 using InteliJ 2018 Start with a sample project generated from the 2.8.2 webAppCreator with the templates maven,sample, readme.

That basic project has packaging set to war

<!-- POM file generated with GWT webAppCreator -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.gwtproject.tutorial</groupId>
  <artifactId>TodoList</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>org.gwtproject.tutorial.TodoList</name>

The gwt-maven-plugin is set to 1.0-rc-8
 <!-- GWT Maven Plugin-->
      <plugin>
        <groupId>net.ltgt.gwt.maven</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>1.0-rc-8</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <moduleName>org.gwtproject.tutorial.TodoList</moduleName>
          <moduleShortName>TodoList</moduleShortName>
          <failOnError>true</failOnError>
          <!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if you use
               a different source language for java compilation -->
          <sourceLevel>1.8</sourceLevel>
          <!-- Compiler configuration -->
          <compilerArgs>
            <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
            <arg>-compileReport</arg>
            <arg>-XcompilerMetrics</arg>
          </compilerArgs>
          <!-- DevMode configuration -->
          <warDir>${project.build.directory}/${project.build.finalName}</warDir>
          <classpathScope>compile+runtime</classpathScope>
          <!-- URL(s) that should be opened by DevMode (gwt:devmode). -->
          <startupUrls>
            <startupUrl>TodoList.html</startupUrl>
          </startupUrls>
        </configuration>
      </plugin>

At this point I can run in DEV mode. Once I change the packaging to gwt-app ( per the plugin's docs https://tbroyer.github.io/gwt-maven-plugin/usage.html) it fails.

[ERROR] Unknown packaging: gwt-app @ line 9, column 14
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project org.gwtproject.tutorial:TodoList:1.0-SNAPSHOT (D:\ToDoList\pom.xml) has 1 error
[ERROR]     Unknown packaging: gwt-app @ line 9, column 14
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

Any idea as to the issue?

thanks

jebrick
  • 339
  • 1
  • 6
  • 14

1 Answers1

1

You're probably missing the <extensions>true</extensions> in the plugin.

Be aware that a gwt-app is only client code, with no server-side at all. I'd suggest using https://github.com/tbroyer/gwt-maven-archetypes instead of the webAppCreator as a starting point. The modular-webapp archetype is functionally identical to the sample project generated by the webAppCreator, but in a more Maven-oriented setup.

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • I would appreciate if you can please take a look at this same gwt-app error using the Broyer plugin https://groups.google.com/g/google-web-toolkit/c/TclImrErWMY/m/phsbWawvDwAJ – likejudo May 02 '21 at 18:44
  • 1
    Move the plugin outside `pluginManagement`. – Thomas Broyer May 02 '21 at 22:27
  • Thanks. I did not see it in the Usage docs. Please consider adding this instruction to the docs for your plugin as it is confusing because the other plugins are in `PluginManagement`.and not in `` – likejudo May 03 '21 at 00:40
  • The doc assumes you know Maven: https://maven.apache.org/guides/mini/guide-configuring-plugins.html, https://maven.apache.org/pom.html#plugin-management. From that last link: “However, this only configures plugins that are actually referenced within the plugins element in the children or in the current POM.” – Thomas Broyer May 03 '21 at 07:11
  • Also perhaps because your plugin is not part of an organization like the Mojo Codehaus plugin, your plugin is not available in my employer's repository. We are strictly not allowed to download and use anything outside the company repo. So I am scratching my head wondering how to make the Mojo plugin to work. – likejudo May 03 '21 at 15:46