您更喜欢哪种方法来改善maven项目的增量构建? [英] What approach of improving incremental building of the maven projects do you prefer?

查看:853
本文介绍了您更喜欢哪种方法来改善maven项目的增量构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将优化构建项目的时间。最耗时的事情之一是项目的汇编。

I am going to optimize time of building our projects. One of the most time-consuming thing is a compilation of the projects.

由于已知的maven问题特别在这里提到:
包含增量构建
我们必须在每个构建过程之前使用 mvn clean

Due to known problem of the maven mentioned in particular here: Maven incremental building we have to use mvn clean before every building process.

我调查了这个问题,发现了两种方法:

I have investigated this question and found out two approaches:


  1. Incremental-build-plugin Maven Mojo

  2. Maven 2 Reactor Plugin

  1. Incremental-build-plugin Maven Mojo
  2. Maven 2 Reactor Plugin

我测试了增量构建插件Maven Mojo 它看起来很不错。我看到 Maven 2 Reactor Plugin 实现了几乎相同的功能但是应该指定特殊命令来实现结果(例如 mvn reactor:make )。

I have tested Incremental-build-plugin Maven Mojo and it looks pretty good. As I see Maven 2 Reactor Plugin implements almost the same functionality but the special command should be specified to achieve results (mvn reactor:make for instance).

所以我得出结论 Maven 2 Reactor插件对于开发人员来说更方便优化本地计算机上的建筑物的时间。但我有一些犹豫,因为 Maven 2 Reactor插件已托管并且(我认为)作为官方maven插件得到支持,但是 Incremental-build-插件Maven Mojo 托管在java.net上。

So I have made conclusion that Maven 2 Reactor Plugin is more convenient only for developers if they are going to optimize time of the buildings on their local computers. But I have some hesitation because Maven 2 Reactor Plugin is hosted and (as I think) is supported as official maven plugin, but Incremental-build-plugin Maven Mojo is hosted on java.net.

我的问题是:


  1. 我的结论是这两个插件解决了几乎相同的问题吗?

  2. 有没有人有使用这两个插件的任何经验并能够提供任何关于它们的反馈?

  3. 您对建筑物的优化还有其他想法吗?


推荐答案

上面提到的两个插件都不会加快你的用例的编译时间。如果你想加快你的编译时间,我建议你使用并行构建支持更新到maven 3。

Both plugins mentioned above won't speed up your compile time for your usecase. if you want to speed up your compile time I'd propose you update to maven 3 with parallel build support.

然而,除了反应堆插件的svn相关功能外,使用maven3开箱即可实现上述插件所做的工作。为此,你需要上一篇文章中提到的jenkins。

However, what is done with the plugins described above can also be achieved out of the box with maven3, except the svn related features of the reactor plugin. for this you'd need jenkins as mentioned in the previous post.

有用的maven 3功能可以加速你的构建:

useful maven 3 features to speed up your build:

mvn clean compile -T 3 (using three threads for paralell builds)

mvn -amd -pl groupid:arifactId (builds the specified projects and all dependent artifacs)

这篇关于您更喜欢哪种方法来改善maven项目的增量构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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