我们目前正在使用 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).
发布评论
评论(4)
如果开发人员不使用 VCS,这不是您唯一的问题:
因此,第一要解决的问题是始终版本文件,即使只有一个开发人员,因为单独工作并不能避免您遇到上述问题。应提醒这些要点(开发人员需要意识到它们以了解其重要性)。
为了确保这种情况发生,您实际上不应该依赖开发人员机器来构建 EAR,而应该依赖作为参考的“外部”进程。您想避免这种综合症:
alt text http://img716.imageshack.us/img716 /9901/worksonmymachinestarbur.png
要实施这样一个过程,您需要自动化构建(即您的整个构建可以在一个命令中运行)并打破与您的依赖关系IDE。换句话说,不要使用 IDE 来构建 EAR,而是使用 Maven 或 Ant (与 IDE 无关)。这将是要解决的第二问题。
一旦您实现了构建过程的自动化,您就可以更进一步并连续运行它:这称为 持续集成 (CI),并允许获得关于变更的频繁、最好是即时的反馈(以避免大爆炸集成问题)。这将是要解决的第三问题。
考虑到您的实际工具集(远非理想,您正在使用的工具没有太多社区支持),我的建议是使用 Ant(或 Maven,如果您对此有一定的了解)进行构建和 Hudson 用于持续集成(因为它非常容易安装和使用,并且它有一个 维度插件)。
If the developer doesn't use the VCS, this is not your only problem:
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).
我的建议是:
Here's my recommendation:
我们所做的是使用 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.
不要从开发人员工作区进行构建,而是设置 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.