如何在 Eclipse 中构建网站项目
我正在启动一个 Web 应用程序项目,该项目将具有 Adobe Flex 前端和 PHP/MySQL 后端。我开发了很多 C++ 桌面应用程序,但对于构建 Web 应用程序和 Eclipse 环境还是新手。我在 Subversion 中将当前的项目结构设置为:
--MyWebsite
+--tags
+--branches
+--trunk
---index.html
+--images
+--BasicHtmlSubSite
+--PHPServices
+--FlexComponentA
我将 trunk 检出到 E:\Dev\Projects\MyWebSite\workspace,该目录也是我的 Eclipse 工作区(但我从 Subversion 中排除了 .metadata 文件夹,并且仅检查在项目中)。
所以我的问题是:
1)这是一个好的网站结构吗?具体来说,我的 Subversion/Eclipse 文件夹结构应该与 htdocs 中的最终文件夹结构有多接近?
2) 如何在 Eclipse 项目中包含index.html(或者也许有一天是index.php)?我尝试将其放入工作区下的静态 HTML 项目 (StaticLandingPage) 中,并添加 FileSync 构建操作以将其移至网络服务器的根目录,但 StaticLandingPage 文件夹也部署到服务器,但我没有这样做想。我只是希望能够将项目内的单个 html 文件部署到 htdocs 目录。
我应该补充一点,我正在 Windows 上进行开发,使用 Eclipse Ganymede、Adobe Flash Builder 4、PDT 2.x、Subclipse、FileSync 和 WST 插件(我认为是)。我正在将 XAMPP 用于本地服务器。
I am starting a web application project that will have an Adobe Flex front-end and a PHP/MySQL back-end. I've developed a lot of C++ desktop applications, but am new to building web applications, and to the Eclipse environment. I have set up my current project structure in Subversion as:
--MyWebsite
+--tags
+--branches
+--trunk
---index.html
+--images
+--BasicHtmlSubSite
+--PHPServices
+--FlexComponentA
I check out trunk into E:\Dev\Projects\MyWebSite\workspace, and that directory is also my Eclipse Workspace (but I excluded the .metadata folder from Subversion, and only check in the projects).
So my questions are:
1) Is this a good site structure? Specifically, how closely should my Subversion/Eclipse folder structure mirror the eventual folder structure in htdocs?
2) How do I include index.html (or maybe index.php someday) in an Eclipse project? I've tried putting it in a Static HTML project (StaticLandingPage) under the workspace, and adding a FileSync build action to move it to the root of the webserver, but the StaticLandingPage folder gets deployed to the server too, which I don't want. I just want to be able to deploy a single html file from within a project to the htdocs directory.
I should add that I'm developing on Windows, with Eclipse Ganymede, Adobe Flash Builder 4, PDT 2.x, Subclipse, FileSync, and the WST plugin (I think it was). I'm using XAMPP for a local server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这在 Eclipse 中根本不起作用。
您通常希望将项目签入 Eclipse 中的某个文件夹或
/trunk/
的根目录中。显然,与将所有内容都塞进主干相比,您可以更好地组织事物,但无论如何,这里有一个示例:示例:
为什么?
1) 在 Eclipse 中签出随机文件是一件痛苦的事情。由于 Eclipse 中的所有内容都是一个项目,因此
.project
文件负责。因此,无论谁查看您的“文件夹”,都将拥有与您相同的项目配置,从而使开发团队更轻松。2)更好地组织多个项目。您可以只拥有多个文件夹,而不是为另一个 Web 项目拥有一个全新的存储库。
This doesn't work well in Eclipse at all.
You usually want your project checked into Eclipse either in a folder or at the root of your
/trunk/
. You can obviously organize things better than shoving everything into trunk, but here's an example anyway:Example:
Why?
1) Checking out random files is a pain in Eclipse. Since everything in Eclipse is a project, the
.project
file rules. Therefore, whoever checks out your "folder" will have the same project configuration as you do, thus making it easier on the development team.2) Better organized for multiple projects. Rather than have a completely new repository for another Web Project, you can just have multiple folders.
我还试图找到一个好的项目结构,但我是从项目需求策略而不是最佳实践策略来实现它的。
我的需求是:
代码。
借鉴常见的、稳定的、经过测试的
源库。
源库分散在
多个存储库。
保持行李箱原始,方便
上传到公共分发站点。
最适合我的结构如下:
I'm also trying to find a good project structure, but am approaching it from a project requirements strategy rather than a best-practices strategy.
My needs are:
code.
draw upon common, stable, tested
source libraries.
source libraries scattered among
multiple repositories.
keep the trunk pristine for easy
upload to public distribution sites.
The structure that works best for me is as follows: