ruby maven is a fully functional maven installation with a ruby command rmvn as launcher.
it also provides an easy way to embed maven with your ruby scripts
require 'maven/ruby/maven'
mvn = Maven::Ruby::Maven.new
mvn.exec( 'install', '-f' 'my-pom.xml' )
in case if JRuby it will run within the same JVM otherwise it will launch java. so you need java installed in any case.
ruby-maven also understands how to use a gemspec file or Gemfile/Jarfile from (J)Bundler as DSL:some magc creates a .pom.xml which is used to run maven.
for a rails application the magic knows how to pack war file of the rails-application
rmvn package -Pproduction
now you can run your war-file with a servlet engine. for example using jetty-run gem:
jetty-run war my.war
for gem project to build an executable single jar with all the classes including jruby itself and all the gems declared. it also packs all the files from the bin directory as well the executable from your embedded gems.
rmvn package -Pexecutable
now you can start your jar with
java -jar my.jar my_command
gem install ruby-maven
or with jruby
jgem install ruby-maven
when using ruby-maven then MRI performs much better due to the fast startup of the interpreter.
to build the gem you need http://maven.apache.org
mvn package
will create the gem in target directory.
to run the specs first you need to get all the files for the gem in place (download them via maven) by executing
mvn process-resources
now
rake
or
jruby -S rake
will run the specs.
the directory layout uses the one which comes from maven itself and thus the ruby code is located under lib/ruby.
rmvn
magic obeys following files
- .gemspec which provides project metadata as well gem dependencies and jar dependencies (via the
requirements
array of the gemspec) - Gemfile,Gemfile.lock provides gem dependencies bundler
- Jarfile,Jarfile.lock provides jar dependencies jbundler (using maven-tools gem)
- Mvnfile is ruby DSL as replacement for pom.xml (using maven-tools gem)
- any jar dependencies in the gemspec
requirements
of any gem is honourede# rts and pull request are most welcome.
bug-reports and pull request are most welcome.