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