Dinsdale
Dinsdale

Reputation: 184

Override Surefire configuration through command line

I think this is a simple problem for a Java DevOps. I have problems with the Surefire parameter which sets the number of test execution threads.

  <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.

Upvotes: 2

Views: 2469

Answers (1)

Gerold Broser
Gerold Broser

Reputation: 14772

You can find the goals of a plugin at the Goals page of every Maven plugin. If you select a specific goal there you see the goal's parameters and for the surefire:test goal there is:

<forkCount> ... User property is: [What a surprise! ;] forkCount

Hence:

mvn ... -DforkCount=1 ...

Upvotes: 4

Related Questions