From e8fc77cccd99d72608487de8aff7b0a1014ac3b7 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sat, 2 Jun 2007 16:31:27 +0000 Subject: [PATCH] o some jruby integration. I will integrate what Eric has made but this allows for some easy experiments with the embedder git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@543754 13f79535-47bb-0310-9956-ffa450edef68 --- maven-embedder/src/bin/mvnr | 6 ++++++ maven-embedder/src/bin/mvnr.rb | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 maven-embedder/src/bin/mvnr create mode 100644 maven-embedder/src/bin/mvnr.rb diff --git a/maven-embedder/src/bin/mvnr b/maven-embedder/src/bin/mvnr new file mode 100755 index 0000000000..7d1cc9fe71 --- /dev/null +++ b/maven-embedder/src/bin/mvnr @@ -0,0 +1,6 @@ +#!/bin/sh + +export M2_HOME=$HOME/m2 +export JRUBY_HOME=$HOME/jruby +export CLASSPATH=$M2_HOME/lib/maven-embedder-2.1-SNAPSHOT-uber.jar +$JRUBY_HOME/bin/jruby $M2_HOME/bin/mvnr.rb diff --git a/maven-embedder/src/bin/mvnr.rb b/maven-embedder/src/bin/mvnr.rb new file mode 100644 index 0000000000..4f5dd81f82 --- /dev/null +++ b/maven-embedder/src/bin/mvnr.rb @@ -0,0 +1,23 @@ +require 'java' + +class Maven + def initialize goals + @goals = goals + end + + include_class 'java.io.File' + include_class 'org.apache.maven.embedder.MavenEmbedder' + include_class 'org.apache.maven.embedder.DefaultConfiguration' + include_class 'org.apache.maven.execution.DefaultMavenExecutionRequest' + + def run + configuration = DefaultConfiguration.new + maven = MavenEmbedder.new(configuration) + r = DefaultMavenExecutionRequest.new + r.setBaseDirectory( File.new( "." ) ) + r.setGoals( @goals ) + result = maven.execute( r ); + end +end + +m = Maven.new( ["clean"] ).run