使用 SVN 和 Eclipse 正确设置 GWT 项目 [英] Setup a GWT Project correctly with SVN and Eclipse

查看:19
本文介绍了使用 SVN 和 Eclipse 正确设置 GWT 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Eclipse 和 Google Web Toolkit 开发一个小项目.这是一个(小)小组项目,所以我想使用 SVN.

到目前为止,我已经在 Eclipse 中创建了一个 GWT 项目并将其添加到我的 SVN 存储库中.问题是,当我在项目上使用编译"时,它会破坏 SVN 的元数据,并且整个战争目录都被标记为已损坏.(红色感叹号).

然后我无法提交和/或更新 - 我也不能因为 web.xml/appengine-web.xml 文件而忽略 war 目录,Eclipse 会在它们丢失时抱怨这些文件......清理也失败了.

>

到目前为止的问题 -你们中有人知道如何使用 SVN 正确设置新的 GWT 项目吗?哪些文件需要忽略?哪些文件可以提交?...

适合初学者的解决方案会很棒!

提前致谢

解决方案

在下面的答案中,我假设您没有使用 Maven.我也尝试笼统地回答,因此以下内容应该适用于任何版本控制系统(我在 Bazaar 上).>

您要提交构成应用程序源代码(例如 *.java 文件)和配置元数据(例如 *.xml 文件)的文件.有些人(像我一样)也喜欢提交 Eclipse 项目配置(.settings、.classpath 和 .project),尽管这样做有时可能会由于不同的 Eclipse 设置而给其他团队成员带来一些不便.我认为不需要猜测项目具有哪些 Eclipse 性质或类路径上应该有什么的便利是值得的(Maven 有助于甚至更多,但这是一个单独的讨论).

您想忽略构建产品的文件和文件夹(因此本质上是临时的和可复制的).对于使用 Google Plugin for Eclipse 在 Eclipse 中开发的 GWT 应用程序,这些通常是 war/WEB-INF/classescode>、war/WEB-INF/deploywar/,其中 是 GWT 使用的名称用于放置编译为 JavaScript/HTML 的 GWT 模块的文件夹.您可能还想排除 .gwt,其中 GWT 在开发模式下工作期间转储日志信息.

同样在您的项目目录中,请务必忽略 gwt-unitCache.这是 gwt 存储为可重用而编译的单元清单的地方.

希望这会有所帮助.

I'm trying to develop a small project using Eclipse and the Google Web Toolkit. It's a (small) group project so I want to use SVN.

So far I have created a GWT Project in Eclipse and added it to my SVN Repository. The problem is that when I use 'compile' on the project, it breaks SVN's metadata and the whole war-directory is marked as broken. (Red Exclamation mark).

I then cannot commit and/or update - neither can I just ignore the war directory because of the web.xml / appengine-web.xml files which Eclipse complains about when they are missing... Cleanup also fails.

So far the problem - Does anyone of you know how to properly set up a new GWT Project with SVN? Which files need to be ignored? Which files can be committed? ...

A beginner-friendly solution would be great!

Thanks in advance

解决方案

In the answer below I'm assuming you're not using Maven. I tried to answer generically as well so the below should apply to any version control system (I'm on Bazaar).

You want to commit the files which constitute the application source code (e.g. *.java files) and configuration metadata (e.g. *.xml files). Some (like me) also like to commit Eclipse project configuration (.settings, .classpath and .project), even though doing so might on occasion cause some inconvenience to other team members due to differing Eclipse setups. I think the convenience of not needing to guess which Eclipse natures the project has or what's supposed to be on the classpath is worth it (Maven helps even more, but that's a separate discussion).

You want to ignore the files and folders which are build products (and hence are temporary and reproducible by nature). For GWT apps developed in Eclipse using the Google Plugin for Eclipse these are typically war/WEB-INF/classes, war/WEB-INF/deploy and war/<module_name>, where <module_name> is the name GWT uses for the folder where it places your GWT module compiled into JavaScript/HTML. You might also want to exclude .gwt where GWT dumps log information during work in Development Mode.

Also in your project directory be sure to ignore the gwt-unitCache. This is where gwt stores a manifest of what units have been compiled for re-usability.

Hope this helps.

这篇关于使用 SVN 和 Eclipse 正确设置 GWT 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆