Wednesday, November 6, 2024

Junit parallel execution Setup in pom.xml

 In maven based Java project, if your project has hundreds of Junit test cases it may take long time to run the application code build. To speed up build execution, it is recommended to setup your project to execute Junit Test in multi threaded parallel fashion. Below is sample code which you can put in your java module's pom.xml file:

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-surefire-plugin</artifactId>

<configuration>

    <parallel>All</parallel>

    <forkCount>2C</forkCount>

    <reuseForks>true</reuseForks>

    <useSystemClassLoader>false</useSystemClassLoader>

</configuration>

</plugin>


Refer official documentation link for more details.

No comments:

Post a Comment

CDN | Clearing Cloudflare cache

In order to clear Cloudflare cache automatically via code, follow below steps: 1. Develop Custom TransportHandler Develop a custom Trans...