使用 Maven 配置 Google Eclipse 插件的正确方法
我知道这个问题已经出现过几次了,但是事情变化得很快,我有点困惑。我正在 Eclipse (J2SE 3.6) 中使用 Maven (m2Eclipse) 和 Google Eclipse 插件(最新版本,截至 2011 年 4 月)开发我的 GWT (2.2.0) 应用程序,它大部分工作正常,直到爆炸!没有任何效果:) 我将我的项目保留在 SVN 中,没有任何 Eclipse 特定的配置文件,并且我无法恢复环境。
因此,我尝试在网络上寻找一些解决方案,并从 gwt-maven-plugin 站点找到了教程,并从 Google Eclipse Plugin 站点找到了新教程,但它们都不起作用 - 我仍然收到 404 错误,以及很多类路径错误。
有人可以告诉我使用 Maven 通过 Google Eclipse 插件在 Eclipse 中运行 GWT 项目的正确方法吗?
这是该项目的 pom.xml 文件: http://pastebin.com/evujwD5F
项目的结构如下这:
|-src
|-main
|-java
|-org.halish.books (package)
|-client
|-(some client stuff)
|-server
|-(server side, async implementations and stuff)
|-share
|-(shared)
|-BooksApp.gwt.xml
|-resources
|-(nothing here)
|-webapp
|-META-INF
|-persistence.xml
|-log4j.properties
|-WEB-INF
|-web.xml
|-BooksApp.html
|-BooksApp.css
|-pom.xml
我真的很感激你的帮助。
问候, 姆赫
I know this question has appeared few times, but the things are changing really fast and I got a little bit confused. I was developing my GWT (2.2.0) application using Maven (m2Eclipse) in Eclipse (J2SE 3.6) with Google Eclipse Plugin (the newest version, as of April 2011) and it mostly worked fine, until bang! nothing works:) I keep my project in SVN without any Eclipse-specific configuration files, and I failed in recovering the environment.
So, I tried looking for some solution in the web, and I found the tutorial from the gwt-maven-plugin site, and the new tutorial from the Google Eclipse Plugin site, but none of them worked - I was still getting the 404 error, and a lot of classpath errors.
Could someone please show me the proper way to run the GWT project in Eclipse with Google Eclipse Plugin using Maven?
Here's the pom.xml file for the project: http://pastebin.com/evujwD5F
And the project's structure looks like this:
|-src
|-main
|-java
|-org.halish.books (package)
|-client
|-(some client stuff)
|-server
|-(server side, async implementations and stuff)
|-share
|-(shared)
|-BooksApp.gwt.xml
|-resources
|-(nothing here)
|-webapp
|-META-INF
|-persistence.xml
|-log4j.properties
|-WEB-INF
|-web.xml
|-BooksApp.html
|-BooksApp.css
|-pom.xml
I'd be really grateful for your help.
Regards,
mh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有几乎相同的项目结构!我最好的建议(当我努力让 Maven 工作时)是给你一个已经工作的示例项目。我这样做是为了开始我的项目,有几次我无法修复我的 POM(我破坏了它:(
我的 module.gwt.xml 和你在同一个地方。很难只需阅读您的 POM 就可以知道,但使用新的 POM“复制”您的内容可能会更容易
使用 GWT 的简单项目
稍微复杂一点使用对象化
I have pretty much the same project structure! My best suggestion (as I struggled to get maven working) is to get you a sample project already working. I did it to kick off my project and a couple of times I couldn't repair my POM (I broke it :(
My module.gwt.xml is at the same place as you. It's hard to tell just by reading your POM but it might be easier to just "copy" your stuff with a new POM.
Simple project with GWT
A bit more complex and using objectify