I'm in the process of Maven-izing my GWT 2.6.1 project (an intermediate 
step to start using GWT 2.7.0), and as a first step want to switch to maven 
style directory structure (as suggested by the Maven GWT Plugin 
documentation 
<http://mojo.codehaus.org/gwt-maven-plugin/user-guide/project.html>), so I 
make two simple moves:

[project]/src => [project]/src/main/java

[project]/test => [project]/src/test/java

But what happens when I do this is that the regular "GWT Compile" from the 
Google Plugin for Eclipse fails with the -strict option, because it tries 
to compile my test classes as GWT source code, and of course can't find the 
classes they reference, for example (source files names obfuscated with 
extra ...'s):

      [ERROR] Errors in 'file:/.../src/test/java/.../...Test.java'
         [ERROR] Line 20: No source code is available for type 
org.junit.Assert; did you forget to inherit a required module?
      (... repeated with many other files)

I'm confused because this doesn't happen with my old directory structure, 
and I don't know why the GWT compiler would go back up into my test 
directory to compile classes there. Strangely, it also doesn't happen with 
this structure, which I accidentally moved to once:

[project]/src => [project]/src/java/main

[project]/test => [project]/src/java/test

It almost seems like the GWT compiler is doing something special with the 
default Maven directory structure. And any of the solutions I can think of 
are not very clean:

- Not use the Google Plugin for Eclipse, but only use the Maven GWT Plugin, 
but then I lose some features from the Google Plugin for Eclipse that I want
- Not compile with -strict, but then I don't catch other warnings as easily
- Use an exclude in my *.gwt.xml source paths to exclude **/*Test.java, but 
then I might still catch some unintended utility classes in my test package
- Not use a parallel package structure for my tests, but then it's not 
possible to test package protected classes and methods
- Not make [project]/src/test/java a source directory in Eclipse, but I 
don't know what the side effects of that are

How are people handling this, or am I missing something?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to