Dynamically set Maven Surefire JVM classpath

Viewed 2095

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.

MAVEN_OPTS = -cp "dir"

This correctly then get's added to the Java arguments

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

ClassLoader cl = ClassLoader.getSystemClassLoader();
URL[] urls = ((URLClassLoader)cl).getURLs();
1 Answers
Related