Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1566

maven-surefire-plugin with reuseForks=false doesn't find any tests in JUnit Jupiter 5.3.0




      This issue was originally reported against JUnit (see https://github.com/junit-team/junit5/issues/1579 ). Christian Stein noted that all the code for the integration resides in the Surefire repo, closed the original issue and requested one be reported here.
      He also noted that https://github.com/apache/maven-surefire/pull/193 , intended to solve SUREFIRE-1564 may fix the problem. Reading through the issue description this doesn't look like an exact duplicate, so I'm reporting the original issue here too - if the same fix addresses both that's great, but just wanted to have this problem on your radar.


      When using a combination of JUnit 5.3.0 together with maven-surefire-plugin 2.22.0 configured with reuseForks=false, surefire fails to find any JUnit tests.

      Downgrading JUnit to 5.2.0 makes it work (i.e., tests are properly found), as does setting reuseForks=true.

      The pom.xml file:

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
            <version>5.3.0</version> <!-- If replaced by 5.2.0, the test executes -->
                <reuseForks>false</reuseForks> <!-- If replace by true, the test executes -->

      A complete example is available in the attached zip file. just unzip and run mvn install.


      With JUnit 5.3.0, you'll see the output:

      Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

      With JUnit 5.2.0, you'll see the expected output:

      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0


        1. reuser-forks.zip
          2 kB
          Allon Mureinik

          Issue Links



              • Assignee:
                tibordigana Tibor Digana
                mureinik Allon Mureinik
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: