默认情况下如何一直运行Maven build多线程 [英] How to run maven build multithreaded all the time by default

查看:50
本文介绍了默认情况下如何一直运行Maven build多线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想节省时间在命令行上键入-T3,因为我希望我将做过的所有Maven构建都可以运行多线程.

Maven 3.3.9我用谷歌搜索,但没有发现任何希望,只是建议为命令行选择添加一个环境变量,并将其附加到命令行上的每个maven调用中.

Maven:在pom.xml中配置并行构建

这样,每次仍然需要手动步骤(输入环境变量的名称)来进行并行构建.

我想在mvn settings.xml文件中进行全局配置.

解决方案

您无法配置 settings.xml 这样的内容.自 Maven 3.3.1 以来,可以对此进行不同的配置./p>

您可以使用文件 $ {maven.projectBasedir}/.mvn/maven.config ,该文件包含在命令中给出的选项,例如在项目的根目录中,该文件可以仅包含:

  -T 3 

但这并不总是基于项目而定.

I want to spare the time typing a -T3 on the command line as I want all the maven builds I will ever do to run multithreaded.

Maven 3.3.9 I googled but didn't find anything promising, only the suggestion to add an environment variable for command line opts and append that to every maven call on commandline.

Maven: configure parallel build in pom.xml

This way, every time, still a manual step is required (entering the environment variable's name) to do a parallel build.

I'd like to configure that globally in the mvn settings.xml file.

解决方案

You can't configure thing like this settings.xml. This can be configured differently since Maven 3.3.1.

You can use a file ${maven.projectBasedir}/.mvn/maven.config which contains the options given on command like within the root directory of your project which simply can contain:

-T 3

but this is limited on a project base not always.

这篇关于默认情况下如何一直运行Maven build多线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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