The setup I use isn't ideal, but it mostly works. I have the code tree set up the way that the maven GWT plugin wants it. Java module code is in src/main/java/[module package]. I have module HTML and CSS in src/main/resources/[module package]/public, though my index.html (containing a redirect to the actual app HTML) is in src/main/webapp. There's probably an opportunity to make something more optimal there. Finally, my web.xml is in src/main/resources/ webapp/WEB-INF.
I use maven to run the app: mvn gwt:run. After building and before running, though, I found that it wants the web.xml to be in war/WEB- INF. I manually copy this from src/, and that only needs to be done when you do a really clean build (including manually removing the war directory, which you should do if you change versions on any of your jars to avoid duplicates). It's not perfect, but I haven't spent the time to figure out how to properly configure the maven GWT plugin. As for IntelliJ, I would recommend using an IDEA 9 Beta or EAP build when using GWT > 1.5. Also, IntelliJ will nicely import maven pom.xml files, so no need to run `mvn idea:idea`. Make sure you accept the GWT facet, since that's what will give you the nice code navigation when using GWT-RPC and such. To configure the facet, you'll need to have GWT downloaded and unpacked somewhere so you can point IntelliJ at it. It's going to warn you "gwt-user.jar library not found in dependencies of module" and give you a "Fix" button. However, I've found that when I do that, I end up with 2 copies of the GWT jars on my classpath (one from IntelliJ's "fix" and the other from maven) and you'll get strange errors about classes not being available because your module doesn't inherit from some module or other that should be included in the base User module, even when your module does inherit User. Removing the jars that IntelliJ added when "fixing" the project (or just not letting it fix it at all) makes these go away. Finally, for running/debugging from IntelliJ, I just have 3 run configurations set up: 2 maven configs (gwt:run and gwt:debug) and one remote debug config. In the debug config, just make sure the port matches the one that maven echos when waiting for a debugger to attach when you run gwt:debug. I hesitated to share all of this because I know it's far from perfect, but maybe you'll find some of it useful. Let us know if you discover any other tricks. -Brian On Dec 7, 11:01 am, "wil.pannell" <[email protected]> wrote: > @Matt: > > Thanks for the post. I'll post back later after I review the app in > IntelliJ. > > @Alexander: > > I'm a newbie (<1 year) doing Java, and I ran into many configuration > issues using Maven in IntelliJ. I also ran into configuration > headaches taking GWT samples, importing them into IntelliJ and getting > the hosted mode debugger to work. Whatever I got working was a hack. > > I hope the post from Matt will help clear up many of the questions I > had. > > On Dec 6, 9:16 pm, Matt Raible <[email protected]> wrote: > > > Here's a sample application that uses GWT 1.7.1 and the Maven GWT > > Plugin. > > >http://static.raibledesigns.com/downloads/gwt-oauth-1.3.zip > > > You should be able to run "mvn idea:idea" to createIntelliJproject > > files. > > > Hope this helps, > > > Matt > > > On Dec 5, 9:13 pm, "wil.pannell" <[email protected]> > > wrote: > > > > This follows up a prior post: can someone with experience post a > > > sample that uses GWT withIntelliJ, maybe even with Maven? > > > > There are very few examples available on the web. I would like > > > particularly to see how the hosted mode debugger can be consistently > > > configured. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
