我可以让 maven-assemble-plugin 运行得更快吗?

发布于 2024-11-03 00:53:13 字数 265 浏览 4 评论 0原文

我有一个 Maven 多模块项目。最终目标包含了我们构建在 tarball 和 RPM 中以供分发的所有库等。这个目标使用了 maven-assemble-plugin,并且需要永远——通常是我们总构建时间的四分之一到一半。

我认为我们已经告诉 Maven 运行多线程(尽管我并不肯定,也不知道如何检查)。我可以做任何其他优化来使拆包/重新打包更快吗?难道只是使用更强大的机器的问题吗?我们的项目看起来没有那么大(最终结果约为 70-80 MB),但仅一个阶段就需要一分钟多的时间。

I have a maven multi-module project. The final goal wraps up all the libraries, etc., that we build in a tarball and RPM for distribution. This goal uses the maven-assembly-plugin, and it takes forever -- usually a quarter to a half of our total build time.

I think we're already telling Maven to run multithreaded (though I'm not positive, and don't know how to check). Is there any other optimization I can do to make unpacking / repacking go faster? Is it just a matter of using a beefier machine? Our project doesn't seem that big (end result is ~70-80 MB) but it takes well over a minute just for that one phase.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

謸气贵蔟 2024-11-10 00:53:13

尝试通过指定 MAVEN_OPTS=-Xmx[某个较大的值] 来增加内存。我设法显着加快它的速度,但它仍然比 tar 慢。如果我有时间,我会获取来源并对其进行分析。

Try increasing memory by specifying MAVEN_OPTS=-Xmx[some large value]. I managed to speed it up significantly, but it is still slower than tar. If I have time I will get the sources and profile it.

不语却知心 2024-11-10 00:53:13

对于具有巨大依赖层次结构的多模块、多级项目,当 Maven Reactor 非常庞大时,我就见过这种情况发生。如果这是您的情况,您可能会考虑将您的 Maven 项目拆分为较小的项目,或者建议/请求改进 Maven 程序集插件。

I've seen this happen when the maven reactor is huge, for a multi-module, multilevel project with enormous dependency hierarchy. If this is the your case, you might consider splitting your maven project to smaller ones, or suggest/ask for improvement for the maven assembly-plugin.

画尸师 2024-11-10 00:53:13

升级到最新版本的 Maven Assembly 插件。新版本比旧版本快得多。

Upgrade to the latest version of the Maven Assembly plugin. Newer versions are much faster than older ones.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文