title: JUnit 5 with Ant junitlauncher: NoClassDefFoundError: org/junit/platform/launcher/core/LauncherFactory
body: <p>i would like to execute junit5 tests in combination with ant, specifically <strong>junitlauncher</strong></p>
  
  <p>here is my project structure:</p>
  
  <p><a href="https://i.stack.imgur.com/04lD2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/04lD2.png" alt="enter image description here"></a></p>
  
  <p>and here is my build file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project default="test" name="test"&gt;
      &lt;property name="src.dir" value="${basedir}/src" /&gt;
      &lt;property name="output.dir" value="${basedir}/build" /&gt;
  
      &lt;!-- PATH DEFINITIONS --&gt;
      &lt;path id="junit5.classpath"&gt;
          &lt;fileset dir="${basedir}/lib/" /&gt;
      &lt;/path&gt;
      &lt;path id="test.classpath"&gt;
          &lt;path refid="junit5.classpath" /&gt;
          &lt;fileset dir="${output.dir}"&gt;
              &lt;include name="**/*.class" /&gt;
          &lt;/fileset&gt;
      &lt;/path&gt;
  
      &lt;target name="clean"&gt;
          &lt;delete dir="${output.dir}" /&gt;
      &lt;/target&gt;
  
      &lt;target name="compile" depends="clean"&gt;
          &lt;mkdir dir="${output.dir}" /&gt;
          &lt;mkdir dir="${output.dir}/report" /&gt;
          &lt;javac srcdir="${src.dir}" destdir="${output.dir}" includeantruntime="false"&gt;
              &lt;!-- test libs --&gt;
              &lt;classpath&gt;
                  &lt;path refid="junit5.classpath" /&gt;
              &lt;/classpath&gt;
          &lt;/javac&gt;
      &lt;/target&gt;
  
      &lt;target name="test" depends="compile"&gt;
          &lt;pathconvert property="classpathProp" refid="test.classpath"/&gt;
          &lt;echo&gt;Classpath is ${classpathProp}&lt;/echo&gt;
          &lt;echo&gt;Running junit tests...&lt;/echo&gt;
          &lt;junitlauncher&gt;
              &lt;classpath refid="test.classpath" /&gt;
              &lt;test name="test.SomeClassTest" /&gt;
          &lt;/junitlauncher&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>when i try to run the test-task, i can see the classpath:</p>
  
  <pre><code>Classpath is 
  /Users/some-username/Documents/workspace/test/lib/junit-jupiter-api-5.3.0-SNAPSHOT.jar:
  /Users/some-username/Documents/workspace/test/lib/junit-jupiter-engine-5.3.0-SNAPSHOT.jar:
  /Users/some-username/Documents/workspace/test/lib/junit-jupiter-migrationsupport-5.3.0-SNAPSHOT.jar:
  /Users/some-username/Documents/workspace/test/lib/junit-jupiter-params-5.3.0-SNAPSHOT.jar:
  /Users/some-username/Documents/workspace/test/lib/junit-platform-commons-1.3.0-SNAPSHOT.jar:
  /Users/some-username/Documents/workspace/test/lib/junit-platform-engine-1.3.0-SNAPSHOT.jar:
  /Users/some-username/Documents/workspace/test/lib/junit-platform-launcher-1.3.0-SNAPSHOT.jar:
  /Users/some-username/Documents/workspace/test/lib/junit-platform-runner-1.3.0-SNAPSHOT.jar:
  /Users/some-username/Documents/workspace/test/lib/junit-platform-suite-api-1.3.0-SNAPSHOT.jar:
  /Users/some-username/Documents/workspace/test/lib/junit-vintage-engine-5.3.0-SNAPSHOT.jar:
  /Users/some-username/Documents/workspace/test/lib/junit.jar:
  /Users/some-username/Documents/workspace/test/lib/org.apiguardian_1.0.0.v20180327-1502.jar:
  /Users/some-username/Documents/workspace/test/lib/org.hamcrest.core_1.3.0.v20180420-1519.jar:
  /Users/some-username/Documents/workspace/test/lib/org.opentest4j_1.0.0.v20180327-1502.jar:
  /Users/some-username/Documents/workspace/test/build/test/SomeClass.class:
  /Users/some-username/Documents/workspace/test/build/test/SomeClassTest.class:
  /Users/some-username/Documents/workspace/test/build/test/TestSuite.class
  </code></pre>
  
  <p>followed by:</p>
  
  <p>BUILD FAILED
  /Users/some-username/Documents/workspace/test/build.xml:36: java.lang.NoClassDefFoundError: org/junit/platform/launcher/core/LauncherFactory</p>
  
  <p>you can find the eclipse project archive here: <a href="https://drive.google.com/file/d/161rYTopmqM3JMqv8kvM6VjJbG1sm-3k2/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/161rYTopmqM3JMqv8kvM6VjJbG1sm-3k2/view?usp=sharing</a></p>
  
  <p>how can i make it work? what am i missing?</p>