2

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.

Andrei
  • 1,613
  • 3
  • 16
  • 36

1 Answers1

1

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.

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • Ah, thanks for clarifications. But if `module.gwt.xml` sits in `src/main` then what happens with the requirement to have all `source path` s entries as child folders of the `gwt.xml` file? (I mean, in the old setup, if I had module `com.example.ExampleModule`, I could only place `client` folder as a child of `com.example`, and I couldn't have for example `com.client`) Is the plugin somehow using the super source feature to workaround this? – Andrei Aug 29 '17 at 21:12
  • It's all about paths in the classpath, not on filesystem, and the file is ultimately renamed into the appropriate place as configured by moduleName. And if your module has no ``, then `client` and `shared` are automatically added for you. – Thomas Broyer Aug 30 '17 at 06:32