tbroyer / gwt-maven-plugin

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

Integration with GWT Eclipse Plugin seems partially broken #146

Closed eliasbalasis closed 3 years ago

eliasbalasis commented 3 years ago

This is a very good directional shift towards better structured GWT projects.

However, the compatibility with "GWT Eclipse Plugin" seems partially broken.

Projects built with this plugin are still recognized by "GWT Eclipse Plugin" but somehow the WAR source files are not copied to the running area.

Would it be correct to assume that due the change in direction this plugin is not meant to work with "GWT Eclipse Plugin"? If yes, then this will disappoint many supporters of "GWT Eclipse Plugin", myself included.

I am very well aware of the runtime classpath issues caused by strong dependency of "gwt-dev" to hardcoded version of "Jetty" and frankly this will always be a problem, with or without use of "GWT Eclipse Plugin". Yet, I believe "GWT Eclipse Plugin" is still useful.

eliasbalasis commented 3 years ago

test-GWT.zip Here is a set of Maven projects I prepared which demonstrates the behavior of both Maven GWT plugins. You can import this in Eclipse of recent version (I used 4.14) with "GWT Eclipse Plugin" installed and "Run As / GWT Development mode with Jetty". Notice that the "test.GWT.legacy" project runs as expected but the "test.GWT.tbroyer" project gets recognized by "GWT Eclipse Plugin" but doesn't deliver the required "index.html" file.

tbroyer commented 3 years ago

I'll have a look at your reproducer but this issue should be in the GWT Eclipse Plugin issue tracker, this is where IDE integration is done.

eliasbalasis commented 3 years ago

Well said.

Unfortunately, I cannot ask "GWT Eclipse Plugin" team to investigate an integration problem with a solution from another vendor, I am certain they will send me back to you, or some teams coordination quite difficult to establish will be required.

Equally, I appreciate this is not your area of responsibility either.

I think I will stay with the legacy "GWT Maven plugin" for now, which does work with "GWT Eclipse Plugin".

tbroyer commented 3 years ago

What I'm saying is that this plugin is 99% IDE-agnostic: the only exception is this file. On the other hand, the GWT Eclipse Plugin has specific code to handle projects using this plugin.

Also, once you've imported the project into Eclipse, you're not using the Maven plugin anymore; the "Run as..." actions are purely Eclipse things, and I have zero idea what they're doing and how they work.

So this is 100% a GWT Eclipse Plugin issue.

BTW, the GWT Eclipse Plugin is a one-man project that hasn't been maintained for more than 2 years now. If I had one advice, it would be to try to make your projects IDE-agnostic; Gradle makes this easier, but there are ways to do it with Maven too (and this plugin tries to make it easy/easier): https://github.com/tbroyer/gwt-maven-archetypes (you'll notice that the Tomcat Maven Plugin is unmaintained too, so use Jetty, despite the necessary hacks to make it work in a reactor build, or enjoy the Maven limitations and mvn install your modules before you can call a plugin, such as Cargo or whatever you need to run your web server, in a specific submodule)

tbroyer commented 3 years ago

Regarding your attached project: the project is not a gwt-app, or at least it's "not only" a gwt-app: it includes an src/main/webapp that no plugin is going to use (the maven-war-plugin is not bound to any phase, so its configuration is mostly useless, unless you specifically call its goals from the command line, such as mvn war:war, but then it'll conflict with the gwt:compile and/or gwt:package-app goals.

This probably explains why it doesn't quite "work" in Eclipse either.

eliasbalasis commented 3 years ago

plugin is 99% IDE-agnostic

This confirms my original suspicion that the plugin is not meant to work with "GWT Eclipse Plugin".

I agree, it is a GWT Eclipse Plugin issue.

Thanks for the advice, I will try to make my projects IDE-agnostic.

However, https://github.com/gwt-plugins/gwt-eclipse-plugin#maven claims to support both Maven plugins Also, the Maven WAR plugin needs to be properly configured, see https://github.com/branflake2267/Archetypes/blob/master/archetypes/gwt-basic/pom.xml I will give it a try