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
This commit is contained in:
Jason van Zyl 2007-06-02 16:31:27 +00:00
parent cc5f2f954b
commit e8fc77cccd
2 changed files with 29 additions and 0 deletions

6
maven-embedder/src/bin/mvnr Executable file
View File

@ -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

View File

@ -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