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
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.
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>