Cool tests in the Java Maven platform now possible with rspec-maven-plugin

I don’t like Maven at all but sometimes depending of the project and the people you need to use this. After playing with RSpec I stop considering any Java language framework acceptable for testing so for this project I’m working on right now I needed to find a solution that could integrate RSpec with Maven.

After googling I found this post from Bob McWhirter where he presented a official rspec-maven-plugin. I tried to use it but it wasn’t working so I forked it, fixed it and changed some things.

The forked version of rspec-maven-plugin is at GitHub and to use it you should:

install the plugin in the local repository (this is necessary only one time):

git clone git://
cd rspec-maven-plugin
mvn install

configure your project’s pom.xml adding this:


set the JRUBY_HOME system variable, for example:

export JRUBY_HOME=/opt/jruby-1.1.6/

The plugin will run in the test phase of the Maven build cycle.

Happy testing!

12 thoughts on “Cool tests in the Java Maven platform now possible with rspec-maven-plugin

  1. Hello,

    I got following error when executing this on win 7.
    Is this pluging not supporting win os, or what could be the problem?
    Have not tried on linux.

    regards, Matti

    [INFO] — rspec-maven-plugin:1.0-beta-6:spec (test) @ vse_mppscripts —
    [INFO] Running RSpec tests from D:\subversion\vse\vse_mppscripts\test\
    [ERROR] error emitting .sh
    at org.codehaus.mojo.rspec.ShellScriptFactory.getScript(
    at org.codehaus.mojo.rspec.AbstractScriptFactory.emit(
    at org.codehaus.mojo.rspec.RspecRunnerMojo.execute(
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(

  2. I got the NPE also. It is caused by a bug in the rspec-maven-plugin. It expects that there is always at least one systemproperty setting in the configuration. Workaround:






  3. Darn, my response was broken by apparently the blogging tool used by this site. Anyway, to fix the NPE add a configuration under rspec-maven-plugin, put systemproperties under it and put any value there.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">