title: JUnit 5 test case not executed
body: <p>I created this test in a new clean Maven project in NetBeans 8.2: </p>
  
  <pre><code>import static org.junit.jupiter.api.Assertions.fail;
  import org.junit.jupiter.api.Test;
  
  public class JUnit501Test {
  
      @Test
      void firstTest() {
          fail("epicly");
      }
  }
  </code></pre>
  
  <p>If I run the tests, the log shows </p>
  
  <pre><code>-------------------------------------------------------
   T E S T S
  -------------------------------------------------------
  Running JUnit501Test
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
  
  Results :
  
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  </code></pre>
  
  <p>My pom.xml contains this dependency:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
      &lt;artifactId&gt;junit-jupiter-api&lt;/artifactId&gt;
      &lt;version&gt;5.0.1&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>What could cause JUnit 5 to ignore the test method?</p>
  
  <p>Update: I added the surefire plugin, here is the full pom.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.timeshuttle&lt;/groupId&gt;
      &lt;artifactId&gt;Junit5Test&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter-api&lt;/artifactId&gt;
              &lt;version&gt;5.0.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;
              &lt;version&gt;5.0.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;/properties&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.20.1&lt;/version&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.junit.platform&lt;/groupId&gt;
                          &lt;artifactId&gt;junit-platform-surefire-provider&lt;/artifactId&gt;
                          &lt;version&gt;1.0.1&lt;/version&gt;
                      &lt;/dependency&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
                          &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;
                          &lt;version&gt;5.0.1&lt;/version&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Output changed to:</p>
  
  <pre><code>-------------------------------------------------------
   T E S T S
  -------------------------------------------------------
  
  Results:
  
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  
  ------------------------------------------------------------------------
  BUILD FAILURE
  ------------------------------------------------------------------------
  Total time: 1.672s
  Finished at: Mon Oct 16 16:19:04 CEST 2017
  Final Memory: 6M/15M
  ------------------------------------------------------------------------
  Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-cli) on project Junit5Test: There are test failures.
  
  Please refer to F:\Sandbox_Java\justin\Junit5Test\target\surefire-reports for the individual test results.
  Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
  There was an error in the forked process
  org.apache.maven.surefire.report.RunListener.testSetStarting(Lorg/apache/maven/surefire/report/ReportEntry;)V
  org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
  org.apache.maven.surefire.report.RunListener.testSetStarting(Lorg/apache/maven/surefire/report/ReportEntry;)V
  at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:673)
  at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:535)
  at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:280)
  at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
  at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1124)
  at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:954)
  at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:832)
  at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
  at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
  at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
  at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
  at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
  at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
  at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
  at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
  at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
  at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
  at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
  at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  -&gt; [Help 1]
  </code></pre>
  
  <p>And the surefire-reports folder contains two ".dump" files. Content of the first one:</p>
  
  <pre><code># Created on 2017-10-16T16:17:32.959
  java.lang.NoSuchMethodError: org.apache.maven.surefire.report.RunListener.testSetStarting(Lorg/apache/maven/surefire/report/ReportEntry;)V
      at org.junit.platform.surefire.provider.JUnitPlatformProvider.invokeSingleClass(JUnitPlatformProvider.java:137)
      at org.junit.platform.surefire.provider.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:126)
      at org.junit.platform.surefire.provider.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:105)
      at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:373)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:334)
      at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:119)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:407)
  </code></pre>