Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

maven plugin to handle rubygems in a maven way. including support for rspec, rails, cucumber, rake, etc

README.textile

maven plugins for jruby

this is fork of http://github.com/jruby/jruby and it basically did some better naming (in my opinion) and added spec goal. allow to reuse AbstactJrubyMojo in other projects and show how to do it in gem-maven-plugin

my problem with maven vs. gem

both project try to solve the same problems. I just wrote a gem for jruby only, now I need to include some java code as a jar file and I depend on 3rd party jars. what shall I do ? pack them all up with the gem. but then I loose all dependency info from my jars and I cannot share them and I might run into version conflicts later since for the gem a packed jar file is just file like any ruby file.

pending: this is an attempt to make gem artifact, make maven use gemcutter (or any other gem repository) extract a minimal pom from the gemspec or so.

how to use it

add following segment to your pom.xml

  <pluginRepositories>
    <pluginRepository>
      <id>saumya</id>
      <name>Saumyas Plugins</name>
      <url>http://mojo.saumya.de</url>
    </pluginRepository>
  </pluginRepositories>

any goal has the properties ‘jruby.version’ and ‘jruby.fork’. you can set via the command line

mvn ruby:jruby -Djruby.args=--version -Djruby.version=1.3.1 -Djruby.fork=false

or you can set them in your settings.xml

  <profiles>
    <profile>
      <id>jruby</id>
      <activation>
         <file>
            <exists>${user.home}/.m2</exists>
         </file>
      </activation>
      <properties>
        <jruby.fork>false</jruby.fork>
      </properties>
    </profile>
  </profiles>

or in your plugin configuration

     <plugin>
        <groupId>de.saumya.mojo</groupId>
        <artifactId>jruby-maven-plugin</artifactId>
	<version>0.4.0</version>
        <configuration>
          <fork>false</fork>
        </configuration>
      </plugin>

when you fork (default) then you can specify the GEM_HOME and GEM_PATH for jruby. the properties for the command line are ‘ruby.gem.home’ and ‘ruby.gem.path’. and they can be set via the settings.xml as well. important: this does not work if you use the embedded jruby !

  <profiles>
    <profile>
      <id>jruby</id>
      <activation>
         <file>
            <exists>${user.home}/.m2</exists>
         </file>
      </activation>
      <properties>
        <jruby.gem.home>${user.home}/.m2/rubygems</jruby.gem.home>
        <jruby.gem.path>${user.home}/.m2/rubygems</jruby.gem.path>
      </properties>
    </profile>
  </profiles>

and the same config inside the pom.xml

      <plugin>
        <groupId>de.saumya.mojo</groupId>
        <artifactId>jruby-maven-plugin</artifactId>
	<version>0.4.0</version>
        <configuration>
          <gemHome>${user.home}/.m2/rubygems</gemHome>
          <gemPath>${user.home}/.m2/rubygems</gemPath>
        </configuration>
      </plugin>
Something went wrong with that request. Please try again.