title: Dynamically set Maven Surefire JVM classpath
body: <p>I'm trying to add the JVM classpath argument when running our Maven unit tests by adding the following maven arguments, with "dir" replaced by my desired clasaspath.</p>
  
  <blockquote>
    <p>MAVEN_OPTS = -cp "dir"</p>
  </blockquote>
  
  <p>This correctly then get's added to the Java arguments </p>
  
  <p>Yet my "dir" is never correctly added to the classpath. 
  The desired file in the classpath is never found, and is always missing when printing out classpath with</p>
  
  <pre><code>ClassLoader cl = ClassLoader.getSystemClassLoader();
  URL[] urls = ((URLClassLoader)cl).getURLs();
  </code></pre>