Just had to solve this problem myself, and I haven't found a simple way :-(
The complicated way is this:
- Download jmock-2.6.0-RC2-jars.zip and unzip into a directory.
- Download http://www.oneeyedmen.com/misc/jmock-2.6.0-RC2.poms.zip and unzip into the same directory.
- Issue the following commands in that directory to install into your local Maven repository
mvn install:install-file -DpomFile=jmock-2.6.0-RC2.pom -Dfile=jmock-2.6.0-RC2.jar
mvn install:install-file -DpomFile=jmock-legacy-2.6.0-RC2.pom -Dfile=jmock-legacy-2.6.0-RC2.jar
mvn install:install-file -DpomFile=jmock-junit4-2.6.0-RC2.pom -Dfile=jmock-junit4-2.6.0-RC2.jar
mvn install:install-file -DgeneratePom -DgroupId=org.hamcrest -DartifactId=hamcrest-core -Dversion=1.3.0RC1 -Dpackaging=jar -Dfile=hamcrest-core-1.3.0RC1.jar
mvn install:install-file -DgeneratePom -DgroupId=org.hamcrest -DartifactId=hamcrest-library -Dversion=1.3.0RC1 -Dpackaging=jar -Dfile=hamcrest-library-1.3.0RC1.jar
mvn install:install-file -DgeneratePom -DgroupId=org.hamcrest -DartifactId=hamcrest-unit-test -Dversion=1.3.0RC1 -Dpackaging=jar -Dfile=hamcrest-unit-test-1.3.0RC1.jar
Then you should be able to use jmock jmock-junit4 and jmock-legacy at version 2.6.0-RC2, with Junit 4.8.1
Caveats - this is entirely unofficial, may conflict horribly with any official jmock poms, may be completely the wrong way to solve this problem, but works for me.