Is there a GWT Maven project structure, that doesn't mix up responsibilities?
gwt, java, maven
Solution
I came to the same conclusion a while ago, and created a couple archetypes to help get started: https://github.com/tbroyer/gwt-maven-archetypes (announcement).
Those archetype still have the `*.gwt.xml` et al. into `src/main/java`, because the Google Plugin for Eclipse didn't support putting them anywhere else (I've heard it's been fixed in a recent version but haven't checked yet).
Problem
I am just getting started with GWT development using Maven as a build system. I come from the Java + Flex world, so naturally I have client side modules and server side modules that are cleanly separated. While digging into the best-practices og GWT and digging deeper and deeper, to me the default configuration of GWT projects feels more and more like a total mess of responsibilities. Especially when it comes to multi-module projects. I did understand, that the convention states that server-side logic belongs in "server" packages, shared code in "shared" and stuff that is compiled to HTML+JavaScript by the GWT compiler in "client" packages. And all code goes to src/main/java. So far so good. No matter how I try to see it ... to me stuff in the "client" packages is simply dead-code. Even if the java compiler compiles this to classes, the classes are never used at runtime and are only needed to provide input to the GWT compiler in the compilation phase. So even if it looks like Java, it's actually not and only looks like Java. It sort of feels dirty to place these inside the same jars as "live" code. Wouldn't a maven structure like this make more sense: ``` /src/ /src/main/ /src/main/java /src/main/shared /src/main/gwt ``` And to have the java-compiler-plugin use src/main/java and src/main/shared and the GWT compiler to use src/main/gwt and src/main/shared? Also it would feel a lot better if the build would produce two types of artifacts ... normal "jars" containing clases from src/main/java and src/main/shared and a second "gwt", which contains classes and sources of src/main/gwt and src/main/shared. I wouldn't add a dependency to some mixed-up jar, but could decide if I want to import some GWT components or if I want to import some server-side functionality. Next thing is that the GWT default is to place xml, resources and other stuff in src/main/java ... XML && Resources != Java ;-) Or is there a real reason for all of this, that I simply haven't realized yet ... or do I simply have to start getting dirty and not worying about stuff like that? Chris