gwt-maven-archetypes with multiple client modules

379 views
Skip to first unread message

kim young ill

unread,
Dec 7, 2012, 3:45:19 AM12/7/12
to google-we...@googlegroups.com
Hi there, i start using this for gwt-modular webapp, quite great, but now i put a second gwt-module in the client package, how to configure the pom file so that both are avail. in -Ddev ?

thanx

Thomas Broyer

unread,
Dec 7, 2012, 4:01:00 AM12/7/12
to google-we...@googlegroups.com, khi...@googlemail.com

On Friday, December 7, 2012 9:45:19 AM UTC+1, kim young ill wrote:
Hi there, i start using this for gwt-modular webapp, quite great,

Thanks
 
but now i put a second gwt-module in the client package, how to configure the pom file so that both are avail. in -Ddev ?

You'll have to replace the <module> with <modules> in the gwt-maven-plugin configuration, and add the modules as <module> child elements. You'd probably want to introduce another property in addition to gwt.module.

Note that I made this dev profile only to make it easier to start up, but I highly recommend you to launch the DevMode from your IDE. gwt:run is far from ideal in this multi-module setup.

Thomas Käfer

unread,
May 22, 2013, 6:09:44 AM5/22/13
to google-we...@googlegroups.com
how to launch the DevMode from within eclipse on a setup with seperate client & server project like your maven-archetype "modular-webapp", without using maven?

I'm trying to find this already for a few weeks, but I did not find a solution yet. 
Problem with the maven gwt:run launch is, that the client-side code isn't debug-able that way --> only server-side with the tomcat7-run can be debugged that way..

I've tried to create an eclipse run configuration analog to my single-project setups, but nothing worked so far...

Thomas Broyer

unread,
May 22, 2013, 6:44:04 AM5/22/13
to google-we...@googlegroups.com


On Wednesday, May 22, 2013 12:09:44 PM UTC+2, Thomas Käfer wrote:
how to launch the DevMode from within eclipse on a setup with seperate client & server project like your maven-archetype "modular-webapp", without using maven?

I'm trying to find this already for a few weeks, but I did not find a solution yet. 
Problem with the maven gwt:run launch is, that the client-side code isn't debug-able that way --> only server-side with the tomcat7-run can be debugged that way..

Yes it is; far from ideal, but it's possible: use gwt:debug instead of gwt:run, and then attach a debugger to the process; see http://mojo.codehaus.org/gwt-maven-plugin/debug-mojo.html

I've tried to create an eclipse run configuration analog to my single-project setups, but nothing worked so far...

It should be as easy as "Debug As… → Web Application (running on an external server)" and using http://localhost:8080/ as the "External server root" and unchecking "Select an HTML page"; assuming you run Tomcat with "mvn tomcat7:run" (or any other setup such that it serves both myapp-client/target/myapp-client-1.0.0-SNAPSHOT and myapp-server/target/myapp-server-1.0.0-SNAPSHOT in the webapp; otherwise just go edit the launch configuration and change the -war to point to the myapp-server/target/myapp-server-1.0.0-SNAPSHOT)

Thomas Käfer

unread,
May 22, 2013, 7:08:38 AM5/22/13
to google-we...@googlegroups.com
Thanks for your reply, and thanks for the info! Have a working debug-able environment now!

With this "Debug As… → Web Application (running on an external server)" on the client project, I get the error "Could not find any host-pages in project <name>-client"
My setup is generated by your maven archetype "modular-webapp" and nearly no changes, only played around with debug configurations and maven a little bit.

But based on your other info I've managed to create a "Web Application" debug configuration manually, and it works!

Huge thanks again! (also for creating these archetypes)

Thomas Broyer

unread,
May 22, 2013, 8:46:53 AM5/22/13
to google-we...@googlegroups.com


On Wednesday, May 22, 2013 1:08:38 PM UTC+2, Thomas Käfer wrote:
Thanks for your reply, and thanks for the info! Have a working debug-able environment now!

With this "Debug As… → Web Application (running on an external server)" on the client project, I get the error "Could not find any host-pages in project <name>-client" 
My setup is generated by your maven archetype "modular-webapp" and nearly no changes, only played around with debug configurations and maven a little bit.

This is strange 'cause I tested it as I was replying, with a freshly created "modular-webapp" project. I had an error about test-client/target/test-client-1.0.0-SNAPSHOT not existing, but that was because I hadn't previously "mvn package" (or even run "mvn tomcat7:run"). I deleted the launch config and started again (Debug As…) and it just worked.

But based on your other info I've managed to create a "Web Application" debug configuration manually, and it works!

That's generally what I do, as I like to have control. 

Thomas Käfer

unread,
May 23, 2013, 6:48:50 AM5/23/13
to google-we...@googlegroups.com
Okey! So you've helped me make a huge step forward yesterday, thanks for that Thomas!

Now I've got a new problem I can't find my way around: I've tried to move the App.java & App*.gwt.xml into from the package "group.id" into the package "group.id.client" package, and adapted the references within the pom.xml and gwt.xml files (and also in gwt.xml change <source path="" /> to <source path="client" /> ), but when I try to do a maven build it always fails:

[INFO] Compiling module group.id.client.App
[INFO]    Finding entry point classes
[INFO]       [ERROR] Unable to find type 'group.id.client.App'
[INFO]          [ERROR] Hint: Previous compiler errors may have made this type unavailable
[INFO]          [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly

The step "Finding entry point classes" takes quite long, around 5 seconds before the failure shows..
When I undo the move and restore the references to group.id.App it works again as expected.

Do you have an idea, what could cause that? Have I missed something that needs adapting when moving the module & entrypoint?

Thomas Broyer

unread,
May 23, 2013, 7:18:47 AM5/23/13
to google-we...@googlegroups.com


On Thursday, May 23, 2013 12:48:50 PM UTC+2, Thomas Käfer wrote:
Okey! So you've helped me make a huge step forward yesterday, thanks for that Thomas!

Now I've got a new problem I can't find my way around: I've tried to move the App.java & App*.gwt.xml into from the package "group.id" into the package "group.id.client" package, and adapted the references within the pom.xml and gwt.xml files (and also in gwt.xml change <source path="" /> to <source path="client" /> ), but when I try to do a maven build it always fails:

[INFO] Compiling module group.id.client.App
[INFO]    Finding entry point classes
[INFO]       [ERROR] Unable to find type 'group.id.client.App'
[INFO]          [ERROR] Hint: Previous compiler errors may have made this type unavailable
[INFO]          [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly

The step "Finding entry point classes" takes quite long, around 5 seconds before the failure shows..
When I undo the move and restore the references to group.id.App it works again as expected.

Do you have an idea, what could cause that? Have I missed something that needs adapting when moving the module & entrypoint?

If you use <source path="client"/> then the gwt.xml has to be in group.id, otherwise only group.id.client.client.* classes are in the source path. group.id.client.App is not an thus cannot be found.

Thomas Käfer

unread,
May 23, 2013, 7:32:30 AM5/23/13
to google-we...@googlegroups.com
Am Donnerstag, 23. Mai 2013 13:18:47 UTC+2 schrieb Thomas Broyer:

If you use <source path="client"/> then the gwt.xml has to be in group.id, otherwise only group.id.client.client.* classes are in the source path. group.id.client.App is not an thus cannot be found.


Oh my god, I'm so stupid.. Thanks so much! I'm really not worth the money they pay me ;)
 
Reply all
Reply to author
Forward
0 new messages