JRuby rake and maven

I cannot stand Maven. It makes me nauseous. However that does not seem to be the case for other institutionalised developers. Here’s what I did on a project where I wanted to isolate its craziness and still use jruby and rake. namespace :maven do M2_HOME = "binaries/apache-maven-3.0.3" desc "Run the maven package goal" task :package => :clean do mvn "package" end desc "Run the application" task :application => :clean do mvn "test-compile", "exec:java", "-Dexec....

RubyGems in a JAR

On a few projects now I’ve used jruby with rake. I know that I can use rvm and just fetch the gems per project, but for developers stuck on windows that way is a little more than difficult. So here’s how I package up rubygems in a JAR. mkdir gemjar java -jar jruby-complete-1.6.3.jar -S gem install -i ./gemjar haml --version 3.1.2 --no-rdoc --no-ri java -jar jruby-complete-1.6.3.jar -S gem install -i ....

JRuby Rake and Ivy

Here’s a neat way of using ivy with jruby, rake & ant. task :ivy_retrieve do ant.taskdef :resource => "org/apache/ivy/ant/antlib.xml" do classpath :location => "ivy/ivy-2.2.0.jar" end ant.configure :file => "ivy/ivysettings.xml" ant.resolve :file => "ivy/ivy.xml" ant.retrieve :pattern => "lib/[conf]/[type]/[artifact]-[revision].[ext]", :sync => "true" puts end Still using ant, still angle bracket free (except for ivy, sigh). Read my previous post if you want to know more about jruby, rake and ant....

JRuby Rake Vs Ant

For the longest time I’ve been writing Java build files in XML and I’ve always felt a little dirty. Not too long ago I was re-introduced to rake by a colleague (thanks Fabio) and how nicely it integrates with ant. This means that you can now turn this: <project name="spring-conversations" default="build" basedir="."> <property name="src.dir" location="src/main" /> <property name="test.dir" location="src/test" /> <property name="build.dir" location="build" /> <property name="dist.dir" location="${build.dir}/dist" /> <property name="report.dir" location="${build....