Raven 1.1: Building More Java with Ruby

Building Java with RubyI’ve just released Raven 1.1 and I’m pretty happy with the new features. For the newcomers Raven is a build system that leverages Ruby tools (namely Rake and Gem) to let you build Java projects easily. It provides a way to handle dependencies, specific Rake tasks for Java and it’s Ruby scripting!

So this latest release lets you install all the dependencies you need directly from the command line. You can install either a single dependency, several dependencies or a whole group. You can also specify the exact version you want or let Raven find the latest one. The package search is based on indexes stored on Raven’s Rubyforge site. These are downloaded (but only if they’ve changed) and the right packages are selected from your search parameters. Then it automatically goes to the Maven repository the artifact comes from, downloads it, wrap it in a Gem and installs it in the Ravem Gem repository. And you’re set!

So it’s as simple as:

raven install httpclient
raven install -g xstream xstream:1.2
raven install –all -g axis2

Neat? Then you can easily write your Rake script to use these dependencies and build your java project using Raven’s java tasks. See my previous post about this.

I have tons of ideas for the next releases, like support for code generation tools (mostly XDoclet and XMLBeans) or making multi-project builds even easier. Something else you’d be interested in?

6 comments so far

  1. bsx on

    Hi,

    Here’s what i’d like to see in Raven:

    1. Ability to specify a group hierarchy:
    Sometime this year, the maven2 mirrors changed their structure so that categories have subcategories and recent releases of packages like Hibernate or Spring are now located in ‘org/hibernate’ or ‘org/springframework’ instead of ‘hibernate’ or ‘springframework’. I would like to be able to add them to my repository by specifying ‘raven repository org.hibernate org.springframework’. Raven doesn’t seem to be capable of this yet.

    2. Multilevel dependencies (just like maven2):
    I specify a dependency to ‘hibernate’ and everything that package ‘hibernate’ depends on will automatically be installed/downloaded into my local/remote repository. Gems are capable of containing these dependency information, so it should just be a matter of adding them and use them while building the repository.

    With these features Raven could be a real Maven killer, since Rake makes it so easy to define new tasks.

  2. mriou on

    Hi,

    Thanks a lot for the feedback. When developing open source software, getting first impressions from users is really important. So here are the answers:

    1. Actually Raven frees you from that sort of detail. There’s an index that lists all artifacts with their respective group. And that index tells Raven where to fetch the dependency. So you just have to know the group and raven will take care of the location. And if you want to use a specific group, then it’s what the -g options does in the examples shown in the post.

    2. I’m not a big fan of transitive dependencies. The build got broken this morning on Apache Ode just because of transitive dependencies. The thing is that people publishing artifacts don’t care much about it, so usually they declare either too many or not enough. Often some dependencies are needed only if you use certain features so you have to get into the exclusion game.

    But it could be a good idea to introduce it as an optional feature. That could help people getting up to speed quickly and then you’d be free to disable it when it starts getting painful. So stick around, that could come maybe not in the next release but right after.

    And thanks again for all your ideas!

  3. Tom on

    I thought gems did transitive dependencies already?

    If I do: gem install rails -y I get all the most recent versions of active-record etc taht the most recent version of rails depends on.

    Or have I misunderstood something?

  4. mriou on

    You didn’t misunderstand anything, gem supports dependencies pretty well already. However to have Raven using this mechanism, it would have to get the dependencies of the jar from the Maven pom.xml and then give them to RubyGems when building the Gem. This isn’t really hard to do, it just requires some parsing. However my experience with Maven repositories is they’re quite messy. Some modules declare their dependencies but other don’t. And often the dependencies are broken too (as not present anymore in the repository).

    The RubyGem central repository is managed by a single source (RubyForge). It’s also true for all Linux package repositories. This guarantees compatibility and a fairly good stability. But it’s not true with Maven repositories, where several different people change whatever they feel like and sometimes (read often) break things. So organizing this mess to make it reliable isn’t an easy task…

  5. Tom on

    So that means that gems generated from ibibio do not have their dependencies included. Can I create my own with their dependencies defined. This is where I see the most value.

  6. mriou on

    Sure, you could. And if you’re willing to contribute this back to Raven, you’re more than welcome 🙂


Leave a comment