GWT compiler can't find sources of depending m

2020-07-23 06:42发布

问题:

I'm using IDEA 117.216

It would be great if CrazyCoder sees this question :)

How do you guys reference another module so GWT compiler sees it ?

When I say module I mean module in IntelliJ IDEA's terminology.

Here is my situation. I have midside project (GAE + GWT + RequestFactory). Now I created Android module in my project. The idea is that it will use C2DM and talk to the server via RequestFactory (RF).

So naturally I created 3rd module within my project and moved all RF proxies and interfaces there so I can reference it both from GWT/GAE module and Android module.

Android module likes it, but GWT compiler doesn't. It can't find classes that I moved to "shared" module. Giving me errors such as:

[ERROR] Errors in 'file:/C:/work/sideprojects/courierapp/src/com/blah/courierApp/client/admin/AdminPage.java'
[ERROR] Line 77: No source code is available for type com.blah.shared.proxies.OrderProxy; did you forget to inherit a required module?
[ERROR] Line 81: No source code is available for type com.blah.shared.factories.AdminRequestFactory; did you forget to inherit a required module?

I need to note that SharedClasses module is added as dependency for GWT module. But still GWT doesn't know where its sources are.

It seems to me it's this bug.

How do you solve this ? I don't really want to have two steps of compilation: build shared classes jar with sources first, then build GWT project that references that jar and etc...

回答1:

It's more like IDEA-67661 where the responsible developer explains why it is so:

IDEA 10 indeed includes to the classpath source roots from modules with GWT facets only. This ensures that unneeded directories aren't added to the classpath. Also you need to have a GWT Facet in a module to enable GWT-specific completion and inspections in it...



回答2:

You must let .java files in the module. GWT compiler works with them, not with .class files.