0

I have multi module maven project, that is build with gwt as a main web framework. Here is github repo.

Everythink works as it should as I supose. I haven't got anything wrong.

Unfortunatelly the problems occur when I try to import this project into eclipse (as maven project). I can not compile this project (using RMB on project in Package Explorer -> Google -> GWT Compile).

I am getting an error:

Loading inherited module 'src.main.resources.pl.derp.parent'
   Loading inherited module 'pl.derp.shared'
      [ERROR] Unable to find 'pl/derp/shared.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

When I tried to RMB on Project name in Package Explorer -> Run -> Run as Web application (GWT Super Dev Mode) I've got:

Working directory does not exist: /home/danielo/eclipseGwt/gwt_2.7.0_maven_eclipse/web/src/main/webapp

I've added modules to build path.

I've followed this instruction

I think, that I've done everything to make it work, but still can make it work.

I think the problem is in packages name, and the way they are treated by maven and eclipse. They are treated in diferent ways.

Maven easily find every class (f.e.: package pl.derp.web;) needed and compile. The eclipse is trying to find them by f.e.: src.main.java.pl.derp.web but can't found it.

Really I don't know how to resolve this issue? I am not sure witch package name patter is better (src.main.java.pl.derp.server or pl.derp.server)- for me the shorter is better.

To run this project in maven (it is well described here):

  • mvn clean install
  • mvn tomcat7:run-war-only

and in second shell:

  • mvn gwt:run -pl web

And in Eclipse I think I am running built in Jetty server

Please give me some help.

masterdany88
  • 5,041
  • 11
  • 58
  • 132

1 Answers1

0

You apparently have a single Eclipse project, with server, shared, and web declared as source directories. When using M2Eclipse, you should have 3 projects, each with their src/{main,test}/{java,resources} declared as source directories. At a minimum, without M2Eclipse, the source directories must be the src/{main,test}/{java,resources}, whether you have 1 or 3 projects.

This is why Eclipse looks for src.main.java.pl.derp.server instead of pl.derp.server, and why GWT fails too (classpath is similarly wrong).

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • Ok. I've fixed it. I use short package names like: `pl.der.web`. But when I tried to compile it using eclipse, I am getting an error: `[ERROR] Unexpected internal compiler error java.lang.NoClassDefFoundError: org/objectweb/asm/MethodVisitor ` ... `Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.MethodVisitor`. I don't have any error in Eclipse IDE. Still using maven it compiles without any error. How should I compile my project? Can I set up in maven compilation output style? – masterdany88 Aug 28 '15 at 09:14