2

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.

5
  • ist kind of Java related Devops so Java experts might not even know. Commented Sep 19, 2019 at 10:58
  • 1
    In short - it it is possible to specify it in <configuration> that the same can be set via CLI. Check configuration options then. Commented Sep 19, 2019 at 11:00
  • seems to be not possible. Except the configuration way :( Commented Sep 20, 2019 at 13:15
  • if it is possible configuration way, you can do the same from CLI. Commented Sep 20, 2019 at 13:57
  • 1
    I encountered issue with CPU usage at 100% when running Maven package for a project. In the POM, forkCount of 4 was specified for the surefire plugin. No matter what command line options I passed, it was always launching 4 JVM processes and CPU usage reached 100%. I didn't find any way to accomplish this. Commented Dec 22, 2023 at 11:36

1 Answer 1

4

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 ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.