When I use the following test I get a WARNING:
WARNING: JMockit was initialized on demand, which may cause certain tests to fail; please check the d
In addition to Gary Rowe's solution:
A more robust (i.e. version and repository path agnostic) integration of JMockit into Surefire would be
<argLine>-javaagent:${org.jmockit:jmockit:jar}
To make this resolution work, the maven-dependency-plugin (version >= 2.5.1!) needs to be configured like this:
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>getClasspathFilenames</id>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>