如何建立一个大型且复杂的Java Web项目以便“试错”这不是浪费时间吗?

发布于 2024-09-14 11:49:02 字数 645 浏览 2 评论 0原文

这个问题有点像项目环境设置的圣杯。理由如下:

大型项目往往文档质量较差,因此存在大量的试错周期。因此,我经常使用一些库(facelets、webflow、tapestry、jrebel...)的 reload-without-redeploy 功能。

使用此类功能的最简单方法是在 VCS 中具有与 servlet 容器中相同的结构,并将 servlet 容器直接指向开发目录。

然而,大型项目通常也会分为某种模块,以避免过于复杂。这意味着 VCS 和 Web 容器中的目录结构非常不同。现在我什至有这样的情况,我有两个项目共享同一个核心项目,我需要同时开发。

如果项目足够小,我将使用 ant 进行增量构建,该构建由 Eclipse 在保存任何文件时运行。但是,如果有数千个文件需要比较时间戳或运行其他一些耗时的操作,那么即使增量构建也会非常烦人。

唯一能让增量构建更快(从而使开发更加愉快)的是某种 IDE 保存操作挂钩,它可以为 ant 提供有关保存内容的更多信息,以便 ant 可以避免不必要的工作。

如果您曾经想过这个问题,请与我分享您的想法 - 您最喜欢的项目设置、IDE 技巧、试错策略批评等等。

例如,我最近注意到新的“Web 部署程序集”功能,但我不知道如何使用它来使部署目录结构在开发过程中与开发目录结构同步,而不是构建。

谢谢

This question is something like a holy grail of project environment setting. Here goes a rationale:

Big projects tends to have poor documentation so there are a lot of trial-and-error cycles. Therefore I often use the reload-without-redeploy feature of some libraries (facelets, webflow, tapestry, jrebel...).

The easiest way to use such feature is to have the same structure in VCS as is in servlet container and point servlet container directly to the development directory.

However big projects are also often divided into some kind of modules to avoid too much complexity. This means that directory structure is very different in VCS and in the web container. Right now I even have a situation where I have two projects sharing the same core project which I need to develop simultaneously.

If the project is small enough, I'm using incremental building with ant that is run by Eclipse on save of any file. But if there are several thousands of files where timestamp needs to be compared or some other time consuming action is run, than even incremental build can be quite annoying.

The only thing that would make incremental builds faster (and therefore makes development MUCH MORE enjoyable) is some kind of IDE save action hooks that would supply ant more information about what is saved so that ant can avoid unnecessary work.

If you have ever though about this, please share your thoughts with me - your favorite project setting, IDE tips, trial-and-error strategy criticism, whatever.

For example I recently noticed the new "Web Deployment Assembly" feature, but I don't know how it can be used to make deployment dir structure synchronized with development dir structure during DEVELOPMENT, not build.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

鱼忆七猫命九 2024-09-21 11:49:02

我不确定 Eclipse,但使用 IntelliJ IDEA,您可以设置一个项目,以便项目目录(即“模块”)按照您想要的方式排列,并且它将保持输出目录与它们同步,将它们更新为更改,甚至自动进行热部署。

I'm not sure about Eclipse, but with IntelliJ IDEA you can set up a project so that the project directories (i.e. "modules") are arranged however you want, and it will keep the output directory in sync with them, updating them as changed, and even doing a hot-deploy automatically.

紫南 2024-09-21 11:49:02

jrebel 没有让您的生活变得更轻松吗?它有 IDE 插件以及 Maven 集成。

Haven't jrebel make your life easier? it has IDE plug-ins as well as maven integration.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文