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

Watch Thread Reply

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.