什么是“反应堆”?在马文?
我一直在阅读有关 Maven Reactor 的内容,并对它的术语用法感到困惑。我读过,多模块是一个反应器,您可以操作 Maven 反应器,并且反应器是一个插件。反应堆到底是什么?
I've been reading about Maven reactor and am confused by its terminology usage. I've read that a multi-module is a reactor, that you can manipulate the maven reactor and that the reactor is a plugin. What exactly is the reactor?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
反应器是 Maven 的一部分,允许它在一组模块上执行目标。正如 Maven 1.x 有关多模块构建的文档 (反应器概念已经存在于 Maven 1.x 中),虽然模块是离散的工作单元,但可以使用反应器将它们聚集在一起以同时构建它们并且:
正如所解释的,反应器使多模块构建成为可能:它计算模块之间依赖关系的有向图,通过拓扑排序从该图导出构建顺序(这就是不允许循环依赖的原因),然后在模块上执行目标。换句话说,“多模块构建”是“反应堆构建”,“反应堆构建”是“多模块构建”。
在 Maven 2.x 中,对多模块构建的支持得到了很大的改进,并且反应器对 Maven 用户变得透明。但它仍然存在并且在幕后使用。
2008 年 9 月(即 Maven 2 推出后很长一段时间),一个 reactor 插件< /a> 的创建是为了能够(再次)与 Maven Reactor 进行更密切的交互。 Brett Porter 在 Reactor:我的新博客中介绍了它最喜欢的 Maven 插件。
大多数 Reactor 插件功能现在都得到原生支持(自 Maven 2.1.0 起)。请参阅 Maven 提示和技巧:高级 Reactor 选项< /a>.
The reactor is the part of Maven that allows it to execute a goal on a set of modules. As mentioned in the Maven 1.x documentation on multi-modules builds (the reactor concept was already there in Maven 1.x), while modules are discrete unit of work, they can be gathered together using the reactor to build them simultaneously and:
As explained, the reactor is what makes multi-module builds possible: it computes the directed graph of dependencies between modules, derives the build order from this graph via topological sort (that's why cyclic dependencies are disallowed) and then executes goals on the modules. In other words, a "multi-modules build" is a "reactor build" and a "reactor build" is a "multi-modules build".
In Maven 2.x, the support of multi-module builds has been very much improved and the reactor has become transparent to Maven users. But it's still there and is used under the hood.
In September 2008 (i.e. a long time after the rollout of Maven 2), a reactor plugin has been created to make it possible to interact (again) more closely with the Maven reactor. Brett Porter blogged about it in Reactor: My New Favourite Maven Plugin.
Most of the reactor plugin features are now natively supported (since Maven 2.1.0). See Maven Tips and Tricks: Advanced Reactor Options.
当项目有多个模块时使用 Reactor。
reactor 完成的工作是:
从 2.1 版本开始,有新的命令行选项,允许您操纵 Maven 构建多模块项目的方式。这些新选项是:
更多详细信息:
Reactor is used when a project has multi-modules.
The work done by reactor is:
Starting with the 2.1 release, there are new command line options which allow you to manipulate the way Maven will build multi-module projects. These new options are:
More details: