简体   繁体   English

通过命令行覆盖 Surefire 配置

[英]Override Surefire configuration through command line

I think this is a simple problem for a Java DevOps.我认为这对于 Java DevOps 来说是一个简单的问题。 I have problems with the Surefire parameter which sets the number of test execution threads.我对设置测试执行线程数的 Surefire 参数有疑问。

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
      <forkCount>2.5C</forkCount>
      <reuseForks>false</reuseForks>
    </configuration>
  </plugin>

I wish I could specify an override from the command line to set it to 1 .我希望我可以从命令行指定一个覆盖以将其设置为1

You can find the goals of a plugin at the Goals page of every Maven plugin.您可以在每个 Maven 插件的目标页面上找到插件的目标。 If you select a specific goal there you see the goal's parameters and for the surefire:test goal there is:如果你 select 有一个特定的目标,你会看到目标的参数,并且对于surefire:test目标有:

<forkCount> ... User property is: [What a surprise; <forkCount> ...用户属性是: [多么惊喜; ;] forkCount ;] forkCount

Hence:因此:

mvn ... -DforkCount=1 ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 覆盖typesafe配置列表以使其在命令行上为空 - override typesafe configuration list to empty on command line 从命令行覆盖pom pluginManagement中定义的Maven插件配置 - Override Maven plugin configuration defined in the pom pluginManagement from the command line 使用命令行参数覆盖spring-boot中的yml配置不起作用 - Override yml configuration in spring-boot with command line arguments not work 使用命令行参数覆盖 spring-boot 中的 yml 配置 - Override yml configuration in spring-boot with command line arguments Maven Surefire仅在命令行上确认“ forkMode” - Maven Surefire only acknowledges “forkMode” on the command line 如何通过命令行参数覆盖属性文件的值? - How to override the properties file value through command line arguments? 如何通过命令行选项使用 Maven Surefire 排除标签? - How to exclude tags with Maven Surefire via command line options? 无法从命令行覆盖pom maven-surefire-plugin - Cannot overwrite pom maven-surefire-plugin from command line 从命令行将JUnit Categories赛跑者与matchAny一起使用以及Maven Surefire - Using JUnit Categories runner with matchAny with Maven Surefire from command line Maven + Surefire:代理配置 - Maven + Surefire: proxy configuration
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM