I have a simple GWT project; I've read here that:

NOTICE There is a new plugin (archetypes and eclipse integration), a fresh start that correctly support multi-module projects, it is not version-bounded with GWT, support multiples GWT versions and other fixes, improvements and best practices. This plugin is now considered the legacy GWT maven plugin (aka mojo GWT maven plugin) and the new one is considered the new generation GWT maven plugin (aka tbroyer GWT maven plugin). The legacy maven plugin is still supported but it is strongly encouraged to use the new one for new projects.

The plugin referenced is:

<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>

I'm trying to update my project to use the new plugin. I have the following problems:

  • No module auto-discovery; with the old Maven plugin, it wasn't mandatory to specify a moduleName; one would get auto-discovered for you (and it was working fine for me). Do you know if there is anything equivalent with the new plugin?
  • If I place my gwt.xml file under src/main/resources instead of src/main/java (which is Maven standard), the the file is not found, and I get a "Module has no entry points defined" error. Is this expected behavior, any reason for this?

So I'm either missing some configuration that should allow me to do what I want, or the plugin is pretty young, and still has some missing things. But if the problem is with the plugin itself, then why does the old plugin page say "The legacy maven plugin is still supported but it is strongly encouraged to use the new one for new projects. " ? It looks like these guys hurried a bit.

1

There are 1 answers

2
Thomas Broyer On BEST ANSWER

The plugin is several years old already and production-ready despite it's RC versioning (disclaimer: plugin author here; versioning was like that to not commit to a forward-compatible configuration, things have been stable for a few versions already)

You're right that you have to explicitly configure the module name (and short name, for staleness checks). The alternative is to put your module at src/main/module.gwt.xml and it'll be renamed (and have rename-to="" appended) to the appropriate name and path.

Did you follow https://tbroyer.github.io/gwt-maven-plugin/migrating.html and set <skipModule>true</skipModule>? Otherwise a dummy module is generated (from src/main/module.gwt.xml actually, which might be absent) and likely overwrites yours. This is actually part of the behaviors that could still change until final release.