tbroyer / gwt-maven-archetypes

Apache License 2.0
152 stars 39 forks source link

Why is codehaus maven plugin used in archetype for ltgt maven plugin? #52

Closed xamde closed 6 years ago

xamde commented 6 years ago

I am just migrating my code from codehaus GWT maven plugin to the newer, maintained, GWT-future-ready ltgt/tbroyer GWT maven plugin. Using the archetypes as a role model. And then this:

https://github.com/tbroyer/gwt-maven-archetypes/blob/master/modular-webapp/src/main/resources/archetype-resources/__rootArtifactId__-shared/pom.xml

uses the codehaus plugin. Is this the tbroyer-recommended way for projects with shared code? Or just a left-over typo? Suggestion: either change to other plugin or add a line of documentation right in the pom why codehaus plugin is used here.

Thanks!

tbroyer commented 6 years ago

Those are actually a leftover from the time where the GWT Eclipse Plugin didn't know about the net.ltgt.gwt.maven:gwt-maven-plugin, to trigger it to add the GWT facet to the Eclipse project. I believe you can now safely switch it to the net.ltgt.gwt.maven groupId with the same effect. Similarly, the gwt-user dependency is here to (IIRC) silence a GWT Eclipse Plugin warning.

If you could confirm that to me (I haven't used Eclipse in years), I'll update the archetypes.

xamde commented 6 years ago

Hi, I had mostly given up my hopes to every try to get Eclipse, GWT, Maven, M2E, GWT-Eclipse-plugin AND GWT-maven-plugin to work together :-) Using your provided archetypes, the GWT Eclipse Plugin neither allows any GWT operation using the codehaus nor the ltgt maven plugin. Which makes sense, since there is no module.gwt.xml and no entrypoint. So for the archetype, one can simply remove the GWT maven plugin declaration completely from the shared project.

xamde commented 6 years ago

There are no warnings, neither from m2e, nor from GWT Eclipse Plugin using either old or new maven plugin.

tbroyer commented 6 years ago

Fwiw, the goal of the profile was to trigger adding the GWT Facet to the shared module in the modular-webapp project, so that you get validation and quick-fixes for the RPC interfaces.

I removed the profile (in 4b76f788dc433a22cf5dc395896d6c0b36292200) as it no longer works as expected (verified locally), but would have to find an alternative.

/cc @branflake2267

branflake2267 commented 6 years ago

Regarding debugging a GWT application with a modular web app. I have several videos aiming at covering different angles and options in doing it. The Archetype modular-webapp covers what I would say is one of the more ideal configurations. But then it's a matter of how to configure your web server because there's both a client and server module.

I've got a playlist, showing how to use Eclipse with different types of servers. https://www.youtube.com/playlist?list=PLBbgqtDgdc_TqzA-qXrjgTFMC_6DKAQyT

In this GXT playlist, the last two videos covers a pom.xml configuration using pom packaging with a gwt-application. Then the following video after it talks about how to combine that with app engine as the server module. I think this may help provide some context on options here. https://www.youtube.com/playlist?list=PLBbgqtDgdc_Se_cs6f6HOV0lYC-VL7naa

Simply put, once you see how the "GWT Development Mode" launcher runs the GWT Code Server, which is used to compile the app and push the bits into the web app directory, things get quite easy to debug on any web application server configuration. And this is pretty easy to do in Eclipse.

@xamde would that help provide some options in debugging a GWT application with Eclipse?

branflake2267 commented 6 years ago

I forgot to mention that both episodes 14 & 15 in the GXT playlist cover two options in debugging with a custom server. In short, using the bookmarklets or launcherDir works with debugging on a custom server. I would lean on the launcherDir config, and watching the videos will provide more context on the options.

tbroyer commented 6 years ago

@branflake2267 How do you get the GWT Eclipse Plugin to apply the GWT Facet to a project? (in this case, the "shared" project, so you get the RPC tooling: validation that methods on the sync interface have corresponding methods on the async interface, and the quick fix to generate them)

I used to have a m2e profile (activated only when importing the project in Eclipse) that added the gwt-maven-plugin and a dependency on gwt-user to trigger the GWT Eclipse Plugin to add the GWT Facet, but that apparently no longer works.

branflake2267 commented 6 years ago

From what I remember, everything is turned on by seeing the dependency in the pom.xml. That said I remember going down that path a few times, but it's vague to me at the moment. To reactivate m2e after the project is imported, all that has to be done is go to the Maven menu and select update. This should reset the gwt settings if needed. If it doesn't then it might be a bug. The facet should get turned on, but I'm not sure that will turn on the GWT nature, I remember hankering around with what controls what. That said, going to the project preferences and selecting the facet is an option, but may not turn on the GWT nature. How would I replicate what you're experiencing?

tbroyer commented 6 years ago

If you create a project using the modular-webapp archetype and import it to Eclipse, the shared module is just a plain Java project; if you change or add a method in the RPC interface, you won't have the validation that the async interface is now wrong. I'd like the GWT facet to be automatically activated on that project on import. I used to do that with an m2e profile (you can see it if you use version 2018.1.15 or earlier if the archetypes, but when I tried it this weekend it didn't work like it used to, even after updating it to the net.ltgt.gwt.maven plugin).

branflake2267 commented 6 years ago

I agree with you, I'd like for it to be automatic too. The Eclipse project configurator is run on the maven import and update. And it should detect the configuration and update it when run.

I'm going to be aiming in the next month or two to do another round of enhancements and fixes on the plugin.

branflake2267 commented 6 years ago

I'm scheduling to do a check this week on the import and update. I'll see what it should be and is doing soon.