InfoQ

News

Raven: Building Java with Ruby

Posted by Rob Thornton on Nov 07, 2006 12:10 PM

Community
Java,
Ruby
Topics
Build systems
Tags
Raven

A new alternative in the building tools space is Raven. Raven allows you to use Ruby tools such as Rake and Gem to build Java projects. Build scripts are Ruby scripts, rather than being XML files, and it imports your local Maven repository and handles dependencies.

Matthiew Riou created Raven because he felt that XML was "painfully awkward when it comes to building things." His secondary motivation was that Ant and Maven do not provide a good way to script the build process. Raven allows you to write your build script in Ruby code, giving you all the flexibility you could need.  Raven wraps jars as Ruby Gems, so that they can be managed by gem.  Gem is a dependency tool that allows you to list, install, and uninstall packages in a single command.  Then you declare the dependencies in a Rake file.

An example of how to install dependencies using Raven is:

    # Installs the latest version of commons-httpclient
 raven install httpclient
 # Installs explicitly xstream 1.2 from the xstream module
 raven install -g xstream xstream:1.2
 # Installs all Axis2 modules (from the axis2 group)
 raven install --all -g axis2

The Rakefile would then use the dependencies:

  dependency 'compile_deps' do |t| 
t.deps << [{'commons-logging' => '1.0.4'}, 'commons-pool']
t.deps << ['commons-lang', 'wsdl4j', 'log4j']
end

javac 'compile' => 'compile_deps' do |t|
t.build_path << "src/main/java"
end

Full examples of a Raven file and to import a Maven repository are available.

Assaf notes that this could be the return of simplicity to the Java world, while Kofno takes a quick look and finds a few concerns including weak Eclipse support and light documentation, specifically in installing a jar that is not in a Maven repository already.  TheServerSide has a discussion thread going where the main concern is introducing yet another language to the development process.  One alternative would be Gant, which is built on Groovy and thus allows you to stick with the JVM.  This concern may disappear as JRuby closes in on 1.0.

No comments

Reply

Exclusive Content

Dan Farino About MySpace’s Architecture

Dan Farino talks about the system architecture and the challenges faced when building a very large online community. Dan explains how a .NET product scales on hundreds of servers.

The Maxine VM

Bernd Mathiske discusses Maxine VM, Java compatibility, swapping major VM components, research areas, Object handling, code examples, optimizing compiler, snippets, bytecode generation, JNI and JIT.

Joe Armstrong About Erlang

Joe Armstrong speaks on various aspects of the Erlang language, presenting its roots, how it compares with other languages and why it has become popular these days.

The Limits of Code Optimization: a new Singleton Pattern Implementation

The java double-check singleton pattern is not thread safe and can’t be fixed. In this article, Dr. Alexey Yakubovich provides an implementation of the Singleton pattern that he claims is thread-safe.

Pressure and Performance – The CTO's Dilemma

Diana and Jim talk about patterns observed in CTOs' activity. CTOs emerge as real people caring for other people in their organization, and are put under a lot of pressure and constraints.

Biztalk Services in the Cloud

Cloud computing feels like a tomorrow technology. Simon Thurman shows how developers can use Biztalk to create an Internet Service Bus which can be deployed locally or in the cloud.

Java FX Technology Preview

InfoQ takes a look at the JavaFX preview build and talks to Sun Staff Engineer Joshua Marinacci about the upcoming version 1 release expected this autumn.

Jeff Sutherland: Reaching Hyper-Productivity with Outsourced Development Teams

Jeff Sutherland, co-creator of Scrum, and Guido Schoonheim, CTO of Xebia, present an actual case of reaching hyper-productivity with a large distributed team using XP and Scrum.