Disha
Disha

Reputation: 832

How to run test cases as separate java process in maven

I have number of test files in my project.

With ant we have

  <batchtest>
        <fileset dir="${test.src.dir}" includes="**/*Test*.java" />
    </batchtest>

which runs each test case as a single java process , thus not giving this issue.

How can I achieve same in maven?

Upvotes: 2

Views: 375

Answers (1)

Tomasz Bawor
Tomasz Bawor

Reputation: 1647

To achieve that you have to set up maven-surefire-plugin in certain way by adding:

 <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.11</version>
        <configuration>
            <forkMode>always</forkMode>
        </configuration>
</plugin>

Upvotes: 2

Related Questions