什么是“反应器"?在Maven? [英] What is the "reactor" in Maven?

查看:93
本文介绍了什么是“反应器"?在Maven?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读有关Maven反应堆的信息,但对其使用的术语感到困惑.我读过一个多模块反应堆,您可以操纵Maven反应堆,而反应堆是一个插件.反应堆到底是什么?

I've been reading about Maven reactor and am confused by its terminology usage. I've read the 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?

推荐答案

反应器是Maven的一部分,允许它在一组模块上执行目标.如Maven 1.x中所述,有关多模块构建的文档(Maven 1.x中已经有了反应堆概念),而模块是分散的工作单元,则可以使用反应堆将它们收集在一起以同时构建它们和:

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:

反应堆根据每个项目在其各自的项目描述符中声明的依赖关系来确定正确的构建顺序,然后执行一组声明的目标.它可以用于建设项目和其他目标,例如网站生成.

The reactor determines the correct build order from the dependencies stated by each project in their respective project descriptors, and will then execute a stated set of goals. It can be used for both building projects and other goals, such as site generation.

正如所解释的,反应堆是使多模块构建成为可能的原因:它计算模块之间依赖关系的有向图,从该图得出构建顺序(这就是为什么不允许循环依赖关系,无论如何这是一件好事),然后在模块上执行目标.换句话说,"多模块构建"是"反应堆构建",而"反应堆构建"是"多模块构建".

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 (that's why cyclic dependencies are disallowed, which is good thing anyway) 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".

在Maven 2.x中,对多模块构建的支持已得到很大改善,并且反应器对Maven用户变得透明.但是它仍然存在并且可以在引擎盖下使用.

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.

2008年9月(即Maven 2推出很长时间之后),一个已经创建了反应堆插件,以使其能够(再次)与Maven反应堆进行更紧密的交互.布雷特·波特(Brett Porter)在反应堆:我的新博客中对此进行了博客最喜欢的Maven插件.

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.

大多数反应堆插件功能现在都受本机支持(自Maven 2.1.0起).参见 Maven提示和技巧:高级反应堆选项.

Most of the reactor plugin features are now natively supported (since Maven 2.1.0). See Maven Tips and Tricks: Advanced Reactor Options.

这篇关于什么是“反应器"?在Maven?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆