views:

59

answers:

2

Hi,

I am unable to include the new jMock release as Maven dependency. Here is what I tried including:

<dependency>
    <groupId>org.jmock</groupId>
    <artifactId>jmock</artifactId>
    <version>2.6.0</version>
</dependency>

I have tried various combinations with the version and artifactId but it doesn't help.

Thanks, Julia.

A: 

Version 2.6.0-RC2 can't be found on public Maven repositories yet. You may want to download it manually from jMock.org download page. If your company uses local Maven repository you can deploy it there. If it's just for your own usage install it in your local Maven repo.

Boris Pavlović
I can't deploy it on the company repo as the dev, QA environments and the CI server fall outside it.
Julia
+1  A: 

Just had to solve this problem myself, and I haven't found a simple way :-(

The complicated way is this:

  1. Download jmock-2.6.0-RC2-jars.zip and unzip into a directory.
  2. Download http://www.oneeyedmen.com/misc/jmock-2.6.0-RC2.poms.zip and unzip into the same directory.
  3. 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.

Duncan McGregor