如何在 Eclipse 中构建网站项目

发布于 2024-08-07 05:59:33 字数 898 浏览 6 评论 0 原文

我正在启动一个 Web 应用程序项目,该项目将具有 Adob​​e 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

阳光下慵懒的猫 2024-08-14 05:59:33

这在 Eclipse 中根本不起作用。

您通常希望将项目签入 Eclipse 中的某个文件夹或 /trunk/ 的根目录中。显然,与将所有内容都塞进主干相比,您可以更好地组织事物,但无论如何,这里有一个示例:

示例:

tags
branches
trunk
   |- MyProject (Eclipse project)
   |      |- php/html/js/whatever files
   |
   |- MyOtherProject (Eclipse project)
   |      |- php/html/js/whatever files
   |
   |- ThirdParty (Also an Eclipse project)
          |- All third party libraries that are shared, if you so wish

为什么?

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:

tags
branches
trunk
   |- MyProject (Eclipse project)
   |      |- php/html/js/whatever files
   |
   |- MyOtherProject (Eclipse project)
   |      |- php/html/js/whatever files
   |
   |- ThirdParty (Also an Eclipse project)
          |- All third party libraries that are shared, if you so wish

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.

不疑不惑不回忆 2024-08-14 05:59:33

我还试图找到一个好的项目结构,但我是从项目需求策略而不是最佳实践策略来实现它的。

我的需求是:

  1. 我想最大限度地重用源代码
    代码。
  2. 我希望文档与项目驻留在同一存储库树中。
  3. 我想要多个项目
    借鉴常见的、稳定的、经过测试的
    源库。
  4. 我不想要
    源库分散在
    多个存储库。
  5. 我想要
    保持行李箱原始,方便
    上传到公共分发站点。

最适合我的结构如下:

-- ROOT
--- README.HTML
+-- trunk
... --- index.html
... +-- glue
... +-- topic[s]
+-- tags
... +-- library_version[s]
+-- branches
... +-- development
... ... +-- topic[s]
... ... ... --- eclipse .project
... ... ... --- eclipse .texlipse
... ... ... --- topic.pdf
... ... ... +-- design
... ... ... ... --- topic.tex
... ... ... ... +-- reuse
... ... ... ... +-- sections
... ... ... ... +-- implementation
... ... ... ... ... --- eclipse .project
... ... ... ... ... --- source.*
... ... ... ... ... +-- contrib[s]
... ... ... ... ... ... --- contrib.oem 
... ... ... ... ... +-- flavor[s]
... ... ... ... ... ...  --- eclipse or other project files
... +-- rfcs
... ... +-- topic[s]
... +-- published_topics
... ... +-- glue
... ... +-- topic[s]

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:

  1. I want to maximize reuse of source
    code.
  2. I want documentation to reside in the same repository tree as the project.
  3. I want multiple projects to
    draw upon common, stable, tested
    source libraries.
  4. I don't want
    source libraries scattered among
    multiple repositories.
  5. I want to
    keep the trunk pristine for easy
    upload to public distribution sites.

The structure that works best for me is as follows:

-- ROOT
--- README.HTML
+-- trunk
... --- index.html
... +-- glue
... +-- topic[s]
+-- tags
... +-- library_version[s]
+-- branches
... +-- development
... ... +-- topic[s]
... ... ... --- eclipse .project
... ... ... --- eclipse .texlipse
... ... ... --- topic.pdf
... ... ... +-- design
... ... ... ... --- topic.tex
... ... ... ... +-- reuse
... ... ... ... +-- sections
... ... ... ... +-- implementation
... ... ... ... ... --- eclipse .project
... ... ... ... ... --- source.*
... ... ... ... ... +-- contrib[s]
... ... ... ... ... ... --- contrib.oem 
... ... ... ... ... +-- flavor[s]
... ... ... ... ... ...  --- eclipse or other project files
... +-- rfcs
... ... +-- topic[s]
... +-- published_topics
... ... +-- glue
... ... +-- topic[s]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文