可能使什么样的配置问题或问题的Maven Assembly插件慢慢走? [英] What sort of configuration issues or problems might make Maven Assembly plugin go slowly?

查看:410
本文介绍了可能使什么样的配置问题或问题的Maven Assembly插件慢慢走?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用我们的多模块Maven项目采取4-6分钟打造。在过去的几个月里,它已经增加到构建20分钟以上。一个症状是,有时构建出​​现暂停,直到我打<输入取代。然而,Maven构建仍然运行我们的构建服务器上精(6分钟,没有停顿)。

Our multi-module Maven project used to take 4-6 minutes to build. Over the past few months, it has increased to 20+ minutes per build. One symptom is that sometimes the build appears to pause until I hit <enter>. However, the Maven build still runs fine (6 minutes, no pauses) on our build server.

构建命令是 MVN清洁套装-D&LT;型材&GT;

我们的一些插件包括:


  • PMD

  • 的FindBugs

  • 大会

  • 节俭编译器

  • JS​​PC-Maven的插件

  • Maven的替代-插件

另外,我们有一个内部的Nexus存储库。

Also, we have an internal Nexus repository.

更新:构建日志

本地编译:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Project Parent ............................. SUCCESS [17.703s]
[INFO] Dependencies ............................... SUCCESS [0.109s]
[INFO] Thrift Service ............................. SUCCESS [1:51.141s]
[INFO] Thrift API Client Sample ................... SUCCESS [14.219s]
[INFO] Application ................................ SUCCESS [14:07.984s]
[INFO] Webapps Parent ............................. SUCCESS [1.250s]
[INFO] Webapp A ................................... SUCCESS [27.547s]
[INFO] Webapp B.................................... SUCCESS [20.672s]
[INFO] Webapp C ................................... SUCCESS [1:14.656s]
[INFO] Assembly ................................... SUCCESS [5:47.219s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24:23.234s
[INFO] Finished at: Fri Jan 27 10:47:38 EST 2012
[INFO] Final Memory: 25M/66M
[INFO] ------------------------------------------------------------------------

生成服务器(团队市):

Build Server (Team City):

[02:16:31]: [INFO] ------------------------------------------------------------------------
[02:16:31]: [INFO] Reactor Summary:
[02:16:31]: [INFO]
[02:16:31]: [INFO] Project Parent ............................. SUCCESS [3.421s]
[02:16:31]: [INFO] Dependencies ............................... SUCCESS [3.157s]
[02:16:31]: [INFO] Thrift Service ............................. SUCCESS [41.314s]
[02:16:31]: [INFO] Thrift API Client Sample ................... SUCCESS [1.220s]
[02:16:31]: [INFO] Application ................................ SUCCESS [4:09.617s]
[02:16:31]: [INFO] Webapps Parent ............................. SUCCESS [0.323s]
[02:16:31]: [INFO] Webapp A ................................... SUCCESS [12.811s]
[02:16:31]: [INFO] Webapp B ................................... SUCCESS [16.496s]
[02:16:31]: [INFO] Webapp C ................................... SUCCESS [19.011s]
[02:16:31]: [INFO] Assembly ................................... SUCCESS [1:45.872s]
[02:16:31]: [INFO] ------------------------------------------------------------------------
[02:16:31]: [INFO] BUILD SUCCESS
[02:16:31]: [INFO] ------------------------------------------------------------------------
[02:16:31]: [INFO] Total time: 7:33.655s
[02:16:31]: [INFO] Finished at: Wed Jan 25 02:16:31 EST 2012
[02:16:31]: [INFO] Final Memory: 42M/317M
[02:16:31]: [INFO] ------------------------------------------------------------------------

更新2

下面是我的版本是花费了大量的时间,使用这个bash脚本提供时间戳分析的实证分析:的 https://gist.github.com/993139

Here is an empirical analysis of where my build is spending most of its time, using timestamp analysis provided by this bash script: https://gist.github.com/993139

在我看来,我可以禁用FindBugs的,PMD和单元测试的一些构建。但我需要最终版本的输出 - 大会。因此,让我关注我的问题 - 是什么可以让Assembly插件运行缓慢

It seems to me that I could disable FindBugs, PMD and Unit Tests for some builds. But I need the final build output - the Assembly. So let me focus my question - what can make Assembly Plugin run slowly?

更新3

正如预期的那样,FindBugs的,PMD和单元测试超过50%削减构建

As expected, FindBugs, PMD and unit tests cut the build by over 50%

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Project Parent .................................... SUCCESS [13.969s]
[INFO] Dependencies ...................................... SUCCESS [0.094s]
[INFO] Thrift Service .................................... SUCCESS [47.125s]
[INFO] Thrift API Client Sample .......................... SUCCESS [11.922s]
[INFO] Application ....................................... SUCCESS [3:10.922s]
[INFO] Webapps parent .................................... SUCCESS [0.468s]
[INFO] Webapp A .......................................... SUCCESS [18.157s]
[INFO] Webapp B .......................................... SUCCESS [18.437s]
[INFO] Webapp C .......................................... SUCCESS [1:00.672s]
[INFO] Assembly .......................................... SUCCESS [3:55.969s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9:58.609s
[INFO] Finished at: Mon Feb 06 10:21:01 EST 2012
[INFO] Final Memory: 24M/59M
[INFO] ----------------------------------------------------------------------

我不认为大会应该采取4分钟。在装配阶段,我看到了很多如下:

I don't think that Assembly should take 4 minutes. During the assembly phase, I'm seeing a lot of the following:

[INFO] --- maven-assembly-plugin:2.2:single (assembly-full) @ assembly ---
[INFO] Reading assembly descriptor: C:\projects\my-project\assembly/src/main/assembly/assembly-full.xml
[INFO] project-2.9.3-SNAPSHOT/config/ already added, skipping
[INFO] project-2.9.3-SNAPSHOT/config/ already added, skipping
[INFO] project-2.9.3-SNAPSHOT/ already added, skipping
[INFO] project-2.9.3-SNAPSHOT/var/ already added, skipping

与每个组件的神器重复。难道这在某种程度上是缓慢的根源?

Repeated with each assembly artifact. Could this somehow be the source of the slowness?

推荐答案

第一个建议是在本地执行的构建和看控制台。这应该可以帮助您轻松识别需要时间最长的插件。

First recommendation is to execute the build locally and watch the console. This should help you to easily identify the plugins that take longest.

从我的记忆,PMD和FindBugs的可以采取相当长的时间来运行。同样适用于大型项目的javadoc。你提到的其他插件,我不能发表评论。

From my recollection, PMD and FindBugs can take considerable amount of time to run. Same goes for javadoc on larger projects. The other plugins you mentioned I cannot comment on.

当然,可能的Nexus如果一个缓慢的系统上运行,也许使用低速存储是一个问题。

Of course, Nexus could be an issue if that runs on a slow system, maybe using slow storage.

啊,只是重新读您的文章:所以这主要发生在本地计算机上。什么是本地计算机在做什么?是否遇到内存不足的情况​​?凡出现停顿也可以给的指示。

Ah, just re-read your post: So it happens on local machines mainly. What is the local machine doing? Does it run into low memory situation? Where the pauses occur could also give an indication.

这篇关于可能使什么样的配置问题或问题的Maven Assembly插件慢慢走?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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