eclipse GWT 编译“添加入口点模块”对话框
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2340132/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
GWT Compile "Add an entry point module" dialog
提问by Alex Worden
Can anyone explain where the Eclipse GWT plugin defines it's entry points?
谁能解释 Eclipse GWT 插件在哪里定义它的入口点?
In an attempt to get my old GWT project working again with GWT 2.0, I created a default GWT 2.0 project in Eclipse and was able to run it successfully. It's the one that asks for a name and calls the 'greet' servlet on the server, which responds etc... so far so good.
为了让我的旧 GWT 项目再次与 GWT 2.0 一起工作,我在 Eclipse 中创建了一个默认的 GWT 2.0 项目并且能够成功运行它。它是一个请求名称并调用服务器上的“问候”servlet 的程序,它做出响应等等……到目前为止一切顺利。
I then ported all the classes from my older maven GWT project over to this new GWT project in the hopes of getting the RPC calls to work. It had many dependencies, so I also copied over the maven pom.xml, commented out all of the gwt related plugins in the pom, and managed to get the Eclipse M2Eclipse maven pluging to recognize the pom and adopt all of the maven dependencies. All of the issues in Eclipse are now resolved and it looks good to go.
然后,我将旧的 maven GWT 项目中的所有类移植到这个新的 GWT 项目中,以期让 RPC 调用能够正常工作。它有很多依赖,所以我也复制了maven pom.xml,注释掉了pom中所有gwt相关的插件,并设法让Eclipse M2Eclipse maven插件识别pom并采用所有maven依赖。Eclipse 中的所有问题现在都已解决,看起来不错。
However, when I click on the GWT compile icon for the project, it pops up a "GWT Compile" dialog now asking me to "Add an entry point module". There are no entry points listed to choose from in this dialog. This is frustrating because I kept the exact same GWTApp.gwt.xml and moved my code into the previously-working auto-generated GWTApp.java class.
但是,当我单击项目的 GWT 编译图标时,它会弹出一个“GWT 编译”对话框,现在要求我“添加入口点模块”。此对话框中没有列出可供选择的入口点。这令人沮丧,因为我保留了完全相同的 GWTApp.gwt.xml 并将我的代码移动到以前工作的自动生成的 GWTApp.java 类中。
I can't imagine why the Eclipse plugin doesn't look in the GWTApp.gwt.xml file to figure out what the entry points are.
我无法想象为什么 Eclipse 插件没有在 GWTApp.gwt.xml 文件中查找入口点是什么。
Can anyone explain how these entry points are defined or suggest why the project stopped working?
谁能解释这些入口点是如何定义的或建议为什么项目停止工作?
Thanks!
谢谢!
采纳答案by Alex Worden
Thanks for the suggestions to my question - you prompted me to find the answer. I looked and did not have any exclusion filters but checked the Java Build Path in the project properties.
感谢您对我的问题提出建议 - 您促使我找到答案。我查看并没有任何排除过滤器,但检查了项目属性中的 Java 构建路径。
When I'd added the maven dependencies, it must have implicitly changed the defined source directory of the GWT eclipse project. (Probably to src/main/java or whatever that dumb long-winded maven default path is). Eclipse offered no hints that the Java classes were not on the project build path. Once I defined the src directory explicitly for the project, the gwt.xml module appeared in the GWT Compile dialog box!
当我添加了 Maven 依赖项时,它必须隐式地更改了 GWT eclipse 项目的定义源目录。(可能到 src/main/java 或任何笨拙冗长的 maven 默认路径)。Eclipse 没有提供 Java 类不在项目构建路径上的提示。一旦我为项目明确定义了 src 目录,gwt.xml 模块就会出现在 GWT 编译对话框中!
On to the next hurdle... coz it still ain't working yet! :(
进入下一个障碍......因为它仍然无法正常工作!:(
Thanks for your help!
谢谢你的帮助!
回答by
I'm certain the following is the problem and solution. I've been doing GWT for about 6 years.
我确定以下是问题和解决方案。我已经做 GWT 大约 6 年了。
Whenever you import an existing maven (namely from a Mojo-generated archtype, but probably others) project into eclipse, you will get a broken configuration which will not allow you to debug until you fix it. But the fix is simple. What happens is the build path will be set to exclude all files from '[proj]/src/main/resources', and this has the effect of hiding the [proj].gwt.xml module file from eclipse. So all the GWT dialogs that look for those modules can't see them! So you can't even create a debug configuration that works.
每当您将现有的 maven(即来自 Mojo 生成的架构类型,但可能是其他的)项目导入 Eclipse 时,您将得到一个损坏的配置,在您修复它之前不允许您进行调试。但修复很简单。发生的情况是构建路径将被设置为从“[proj]/src/main/resources”中排除所有文件,这具有从 Eclipse 中隐藏 [proj].gwt.xml 模块文件的效果。所以所有寻找这些模块的 GWT 对话框都看不到它们!所以你甚至不能创建一个有效的调试配置。
Here's the fix:
这是修复:
Right-click the project, and open Properties -> Build Path dialog -> Source Tab, and look for the one ending in '.../src/main/resources', and you will see it has excluded: . So highlight just that entry and remove the '', so that it reads "Excluded: (None)". Now the dialogs (namely the debug configuration dialog), for GWT will all see your module file, and everything will work.
右键项目,打开属性->构建路径对话框->源标签,找到以'.../src/main/resources'结尾的那个,你会看到它已经排除了:。因此,只突出显示该条目并删除“”,使其显示为“排除:(无)”。现在,GWT 的对话框(即调试配置对话框)都将看到您的模块文件,并且一切正常。
回答by VonC
Just to be sure, that wouldn't be similar to this case, where the exclusion filter was a bit too large?
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes"
path="target/base-resources"/>
I think that you may have an exclusion filter which is too aggressive on your "
target/base-resources
" directory.
It seems that you have an exclusion filter of "*
*". Won't that match everything?You are right! This was the problem! :)))
I didn't know what the exclusion filter was and somehow it was added automatically during the development.
我认为您的“
target/base-resources
”目录可能有一个过于激进的排除过滤器。
您似乎有一个“*
*”的排除过滤器。这不会匹配一切吗?你是对的!这就是问题所在!:)))
我不知道排除过滤器是什么,并且在开发过程中以某种方式自动添加。
回答by jim
Sonatype's eclipse maven plugin is infamous for many things. One of them is excluding all the files in your resources maven folder for a given module whenever you allow it to rebuild the eclipse classpath.
Sonatype 的 eclipse maven 插件在很多方面都是臭名昭著的。其中之一是在您允许给定模块重建 eclipse 类路径时排除给定模块的资源 maven 文件夹中的所有文件。
m2eclipse will probably be the single reason that I re-evaluate using Intellij...
m2eclipse 可能是我使用 Intellij 重新评估的唯一原因...
回答by Andrey Uglev
I had the same problem.
我有同样的问题。
Right click the project and select properties.....
右键单击项目并选择属性.....
There was empty dialog (no entry points suggested).
After some digging I found that mymodule.gwt.xml file was accidentally marked as "lib" in .classpath (eclipse project file in the root of the project folder). I seems it was marked as "lib" on .classpath automatic generation (I was importing clean maven GWT project, not eclipse project).
有空对话框(没有建议的入口点)。
经过一番挖掘,我发现 mymodule.gwt.xml 文件在 .classpath(项目文件夹根目录中的 eclipse 项目文件)中被意外标记为“lib”。我似乎在 .classpath 自动生成中被标记为“lib”(我导入的是干净的 maven GWT 项目,而不是 eclipse 项目)。
Simply delete line with mymodule.gwt.xml from .classpath file, cause it is in src/main/resources, that is normal "src" classpath.
只需从 .classpath 文件中删除带有 mymodule.gwt.xml 的行,因为它在 src/main/resources 中,即正常的“src”类路径。
回答by Carnell
Right click the project and select properties. Expand and select Google -> Web Toolkit. The right pane will have a section called Entry Point Modules. Click the add button and select your .gwt.xml file.
右键单击项目并选择属性。展开并选择 Google -> Web Toolkit。右窗格将有一个名为Entry Point Modules的部分。单击添加按钮并选择您的 .gwt.xml 文件。