简体   繁体   English

Maven Gwt原型错误

[英]Maven Gwt Archetype errors

So I tried to get the Maven Gwt archetype up and running. 因此,我尝试启动并运行Maven Gwt原型。 So some background info, I got Maven 3.0, and I have JDK 1.7 in Eclipse. 因此,我提供了一些背景信息,包括Maven 3.0和Eclipse中的JDK 1.7。

I ran the archetype, imported the project, and had a bunch of warnings and errors, I solved most of them but this one: GWT SDk servlet.jar was missing in WEB-INF/lib So I searched stack overflow, and used someones suggestion of using quick-fix to synchronize them. 我运行了原型,导入了项目,并且遇到了一堆警告和错误,我解决了大多数警告和错误,但是这个问题:WEB-INF / lib中缺少GWT SDk servlet.jar,所以我搜索了堆栈溢出,并使用了一些建议使用快速修复来同步它们。 Now I get a warning saying that I have not J2SE1.5 installed. 现在,我得到一个警告,说我尚未安装J2SE1.5。

Do I need J2SE1.5 to run my web app? 我需要J2SE1.5来运行我的Web应用程序吗? Why is JDk 1.7 not enough? 为什么JDk 1.7还不够?

Next, I get the warning 接下来,我得到警告

  Classpath entry com.google.gwt.eclipse.core.GWT_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result.

Which I also have no clue why it is saying that. 我也不知道为什么这么说。

But I am able to run the clean install gwt:run Maven goals without any problems. 但是我能够运行全新安装gwt:run Maven目标而没有任何问题。

I could suppress the warnings but my ADD would kill me, I'd rather understand the issues if I am going to just ignore them. 我可以取消这些警告,但是我的ADD会杀死我,如果我不理会它们,我宁愿理解这些问题。

If you have a GWT_CONTAINER entry in your build-path with a Maven project, then you're doing it wrong ( gwt-maven-plugin archetype most probably does it wrong, but I don't have the patience to fix all its warts and nobody else seems to bother; maybe we should simply get rid of it). 如果您在带有Maven项目的构建路径中具有GWT_CONTAINER条目,则说明您做错了( gwt-maven-plugin原型很可能做错了,但是我没有耐心修复所有缺陷并似乎没有其他人打扰;也许我们应该简单地摆脱它)。

You should first install the Google Plugin for Eclipse (GPE), which works hand-in-hand with M2Eclipse (M2E) to autoconfigure the project when it detects it's a GWT project (makes use of the gwt-maven-plugin IIRC). 您应该首先安装Google Eclipse插件(GPE),该插件与M2Eclipse(M2E)协同工作,以在检测到它是GWT项目时自动配置该项目(利用gwt-maven-plugin IIRC)。

Then make sure you don't have any .project , .classpath or .settings/ files/folders and import your Maven project in Eclipse. 然后,确保您没有任何.project.classpath.settings/文件/文件夹,并将您的Maven项目导入Eclipse。 M2E and GPE should do everything for you. M2E和GPE应该为您做所有事情。 In the event that GPE doesn't add the GWT nature to your project, go check "Google Web Toolkit" in the project preferences, you'll see that GPE will have automatically selected the gwt-user from your POM as the GWT SDK . 如果GPE没有为您的项目添加GWT性质,请在项目偏好设置中选中“ Google Web Toolkit”,您会看到GPE将自动从POM中选择gwt-user作为GWT SDK

See http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven (which suggests avoiding the gwt-maven-plugin archetype). 请参阅http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven (建议避免使用gwt-maven-plugin原型)。

All in all, it's easier to simply start from scratch: add a dependency on gwt-user and add the gwt-maven-plugin , then do everything else with GPE wizards in Eclipse. 总而言之,从头开始更容易:添加对gwt-user的依赖关系并添加gwt-maven-plugin ,然后使用Eclipse中的GPE向导进行其他操作。
You might also find https://github.com/tbroyer/gwt-maven-archetypes helpful. 您可能还会发现https://github.com/tbroyer/gwt-maven-archetypes有帮助。

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

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