Java EE:需要更好的部署系统

发布于 2024-08-24 04:41:22 字数 192 浏览 5 评论 0 原文

我们目前正在使用 JDeveloper 来构建我们的生产 EAR。这样做的一个问题是,如果开发人员不向 VCS 添加新文件,那么该开发人员是唯一能够制作 EARS 的人,因此他也可以使用未版本化的文件。

有什么好的系统可以将其分开,以便可以正确生成 EAR 文件,而不依赖于本地开发人员工作区(这也将确保他们在允许部署/签入之前将其文件添加到 VCS)。

We are currently using JDeveloper to build our production EARs. One problem with this is that if the developer doesn't add new files to a VCS, then that developer is the only one capable of making EARS, and therefore he can use unversioned files as well.

What would be a good system that seperates this, so that EAR files can be correctly produced without depending on the local developers workspace (this would also ensure that they add their files to a VCS before allowing to make a deployment/check-in).

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

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

发布评论

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

评论(4

身边 2024-08-31 04:41:22

这样做的一个问题是,如果开发人员不向 VCS 添加新文件,那么该开发人员就是唯一有能力制作 EARS 的人,

如果开发人员不使用 VCS,这不是您唯一的问题:

  • 您不能在另一个环境中重现事物,您就与开发人员计算机绑定在一起(但您知道这一点)。如果他生病了怎么办?
  • 不对文件进行版本控制意味着您没有任何修改历史记录,并且您不知道将哪些内容投入生产(“嗯,这个版本中有什么?等等,让我们打开 EAR 来检查一下。”)。
  • 最后但并非最不重要的一点是,如果发生硬件故障(例如硬盘驱动器崩溃),您可以告别 VCS 中没有的所有内容。

因此,第一要解决的问题是始终版本文件,即使只有一个开发人员,因为单独工作并不能避免您遇到上述问题。应提醒这些要点(开发人员需要意识到它们以了解其重要性)。

为了确保这种情况发生,您实际上不应该依赖开发人员机器来构建 EAR,而应该依赖作为参考的“外部”进程。您想避免这种综合症:

alt text http://img716.imageshack.us/img716 /9901/worksonmymachinestarbur.png

要实施这样一个过程,您需要自动化构建(即您的整个构建可以在一个命令中运行)并打破与您的依赖关系IDE。换句话说,不要使用 IDE 来构建 EAR,而是使用 MavenAnt (与 IDE 无关)。这将是要解决的第二问题。

一旦您实现了构建过程的自动化,您就可以更进一步并连续运行它:这称为 持续集成 (CI),并允许获得关于变更的频繁、最好是即时的反馈(以避免大爆炸集成问题)。这将是要解决的第三问题。

考虑到您的实际工具集(远非理想,您正在使用的工具没有太多社区支持),我的建议是使用 Ant(或 Maven,如果您对此有一定的了解)进行构建和 Hudson 用于持续集成(因为它非常容易安装和使用,并且它有一个 维度插件)。

One problem with this is that if the developer doesn't add new files to a VCS, then that developer is the only one capable of making EARS,

If the developer doesn't use the VCS, this is not your only problem:

  • You cannot reproduce things in another environment, you're tied to the developer machine (but you're aware of that). What if he is sick?
  • Not versioning files means you don't have any history of modifications and that you don't know what you put into production ("Hmm, what is in this version? Wait, let's open the EAR to check that.").
  • And last but not least, in case of hardware failure (e.g. a hard drive crash), you can say good bye to everything that is not in the VCS.

So, the first thing to fix is to ALWAYS version files, even if there is only one developer as working alone doesn't save you from the mentioned problems. These points should be reminded (the developer needs to be aware of them to understand their importance).

To make sure this happens, you should actually not rely on the developer machine to build the EAR but rather rely on an "external" process that would be the reference. You want to avoid this syndrome:

alt text http://img716.imageshack.us/img716/9901/worksonmymachinestarbur.png

To put such a process in place, you need to automate the build (i.e. your whole build can be run in one command) and to break the dependency with your IDE. In other words, do not use the IDE to build your EAR but rather use a tool like Maven or Ant (which are IDE agnostic). That would be the second thing to fix.

Once you'll have automated your build process, you could go one step further and run it continuously: this is called Continuous Integration (CI) and allows to get frequent, ideally immediate, feedback about changes (to avoid big bang integration problems). That would be the third thing to fix.

Given your actual toolset (which is far from ideal, there is not much community support for the tools you are using), my recommendation would be to use Ant (or Maven if you have some knowledge of it) for the build and Hudson for the continuous integration (because it's extremely easy to install and to use, and it has a Dimensions plugin).

调妓 2024-08-31 04:41:22

我的建议是:

  1. 获取更好的 IDE - IntelliJ、Eclipse 或 NetBeans。没有人使用 JDeveloper
  2. 让开发人员检查 Subversion 或 Git 等中央版本控制系统。
  3. 使用 Ant 和 Cruise Control 或 Hudson 设置持续集成工具来自动化构建。

Here's my recommendation:

  1. Get a better IDE - IntelliJ, Eclipse, or NetBeans. Nobody uses JDeveloper
  2. Have developers check into a central version control system like Subversion or Git.
  3. Set up a continuous integration facility using Ant and either Cruise Control or Hudson to automate your builds.
情深已缘浅 2024-08-31 04:41:22

我们所做的是使用 cruisecontrol。它做了两件事,它让我们能够进行持续集成构建,这样我们就有夜间构建以及每次检查更改时构建的轻量级构建。

我们还使用它来更具体地解决您的问题。当我们想要发布时,我们使用 Cruisecontrol 来启动构建,该构建被标记为正确的生产构建版本。它将从我们的版本控制系统(我们使用 SVN)获取代码并在此基础上进行构建,因此它不依赖于开发人员的本地环境。

您可能还需要考虑的一件事是创建一个生产分支来构建。因此,特定版本的生产耳朵始终是从该分支构建的。通过这种方式,您甚至可以更好地控制构建的内容。

What we do is use cruisecontrol. It does two things, it lets us do continuous integration builds, so that we have nightly builds as well as lightweight builds that get built every time a change is checked it.

We also use it to more specifically address your issue. When we want to ship, we use cruisecontrol to kick off a build, that is tagged with the proper production build version. It will grab the code from our version control system (we use SVN) and will build on that, so it is not dependent on developers local environments.

One thing you might also want to consider is creating a production branch to build out of. So, production ears for a particular release are always built from that branch. This way you have even have a bit more control over what goes into the build.

小猫一只 2024-08-31 04:41:22

不要从开发人员工作区进行构建,而是设置 Maven,并让 Hudson 之类的东西运行您的 Maven 构建。此构建的人工制品(您的耳朵)已得到部署。

Instead of doing builds from developer workspaces, setup Maven, and have something like Hudson run your Maven build. The artificats of this build (your ear) gets deployed.

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