简体   繁体   English

GWT编译器无法在IntelliJ IDEA中找到依赖模块的源

[英]GWT compiler can't find sources of depending module in IntelliJ IDEA

I'm using IDEA 117.216 我正在使用IDEA 117.216

It would be great if CrazyCoder sees this question :) 如果CrazyCoder看到这个问题会很棒:)

How do you guys reference another module so GWT compiler sees it ? 你们如何引用另一个模块,以便GWT编译器看到它?

When I say module I mean module in IntelliJ IDEA's terminology. 当我说模块时,我指的是IntelliJ IDEA术语中的模块。

Here is my situation. 这是我的情况。 I have midside project (GAE + GWT + RequestFactory). 我有中间项目(GAE + GWT + RequestFactory)。 Now I created Android module in my project. 现在我在我的项目中创建了Android模块。 The idea is that it will use C2DM and talk to the server via RequestFactory (RF). 这个想法是它将使用C2DM并通过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. 所以我自然而然地在我的项目中创建了第3个模块并移动了所有RF代理和接口,因此我可以从GWT / GAE模块和Android模块中引用它。

Android module likes it, but GWT compiler doesn't. Android模块喜欢它,但GWT编译器不喜欢它。 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. 我需要注意, SharedClasses模块被添加为GWT模块的依赖项。 But still GWT doesn't know where its sources are. 但GWT仍然不知道它的来源在哪里。

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... 我真的不想有两个编译步骤:首先用源代码构建共享类jar,然后构建引用jar等的GWT项目......

It's more like IDEA-67661 where the responsible developer explains why it is so: 它更像是IDEA-67661 ,负责任的开发人员解释了为什么会这样:

IDEA 10 indeed includes to the classpath source roots from modules with GWT facets only . IDEA 10确实包含来自具有GWT方面的模块的类路径源根。 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... 您还需要在模块中安装GWT Facet以启用GWT特定的完成和检查...

You must let .java files in the module. 您必须在模块中放入.java文件。 GWT compiler works with them, not with .class files. GWT编译器使用它们,而不是.class文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM