de.saumya.mojo.jruby
Class AbstractJRubyMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by de.saumya.mojo.jruby.AbstractJRubyMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractGemMojo

public abstract class AbstractJRubyMojo
extends org.apache.maven.plugin.AbstractMojo

Base for all JRuby mojos.


Field Summary
protected  java.lang.String args
          common arguments
Command line -Dargs=...
protected  org.codehaus.classworlds.ClassRealm classRealm
          classrealm for internal use.
protected static java.lang.String DEFAULT_JRUBY_VERSION
           
protected  de.saumya.mojo.ruby.script.ScriptFactory factory
           
protected static java.lang.String JRUBY_COMPLETE
           
protected static java.lang.String JRUBY_CORE
           
protected static java.lang.Object JRUBY_STDLIB
           
protected  boolean jrubyFork
          fork the JRuby execution.
protected  java.lang.String jrubyJvmArgs
          jvm arguments for the java command executing jruby
Command line -Djruby.jvmargs=...
protected  java.lang.String jrubySwitches
          switches for the jruby command, like '--1.9'
Command line -Djruby.switches=...
protected  boolean jrubyVerbose
          verbose jruby related output
Command line -Djruby.verbose=...
protected  java.lang.String jrubyVersion
          if the pom.xml has no runtime dependency to a jruby-complete.jar then this version is used to resolve the jruby-complete dependency from the local/remote maven repository.
protected  java.io.File libDirectory
          directory with ruby sources - added to ruby loadpath only
Command line -Djruby.lib=...
protected  org.apache.maven.artifact.repository.ArtifactRepository localRepository
          local repository for internal use.
protected  de.saumya.mojo.ruby.Logger logger
           
protected  org.apache.maven.project.MavenProject project
          reference to maven project for internal use.
protected  org.apache.maven.repository.RepositorySystem repositorySystem
           
protected  java.io.File rubySourceDirectory
          directory with ruby sources - added to java classpath and ruby loadpath
Command line -Djruby.sourceDirectory=...
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractJRubyMojo()
           
 
Method Summary
 void execute()
           
protected abstract  void executeJRuby()
           
protected  java.io.File launchDirectory()
           
protected  de.saumya.mojo.ruby.script.ScriptFactory newScriptFactory()
           
protected  de.saumya.mojo.ruby.script.ScriptFactory newScriptFactory(org.apache.maven.artifact.Artifact artifact)
           
protected  org.apache.maven.artifact.Artifact resolveJRubyArtifact()
           
protected  org.apache.maven.artifact.Artifact resolveJRubyCompleteArtifact(java.lang.String version)
           
protected  org.apache.maven.artifact.Artifact retrieveStdlibArtifact()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JRUBY_COMPLETE

protected static final java.lang.String JRUBY_COMPLETE
See Also:
Constant Field Values

JRUBY_CORE

protected static final java.lang.String JRUBY_CORE
See Also:
Constant Field Values

JRUBY_STDLIB

protected static final java.lang.Object JRUBY_STDLIB

DEFAULT_JRUBY_VERSION

protected static java.lang.String DEFAULT_JRUBY_VERSION

args

protected java.lang.String args
common arguments
Command line -Dargs=...


jrubyJvmArgs

protected java.lang.String jrubyJvmArgs
jvm arguments for the java command executing jruby
Command line -Djruby.jvmargs=...


jrubySwitches

protected java.lang.String jrubySwitches
switches for the jruby command, like '--1.9'
Command line -Djruby.switches=...


jrubyVersion

protected java.lang.String jrubyVersion
if the pom.xml has no runtime dependency to a jruby-complete.jar then this version is used to resolve the jruby-complete dependency from the local/remote maven repository. it overwrites the jruby version from the dependencies if any. i.e. you can easily switch jruby version from the commandline !
default: 1.6.2
Command line -Djruby.version=...


jrubyFork

protected boolean jrubyFork
fork the JRuby execution.
Command line -Djruby.fork=...


jrubyVerbose

protected boolean jrubyVerbose
verbose jruby related output
Command line -Djruby.verbose=...


rubySourceDirectory

protected java.io.File rubySourceDirectory
directory with ruby sources - added to java classpath and ruby loadpath
Command line -Djruby.sourceDirectory=...


libDirectory

protected java.io.File libDirectory
directory with ruby sources - added to ruby loadpath only
Command line -Djruby.lib=...


project

protected org.apache.maven.project.MavenProject project
reference to maven project for internal use.


localRepository

protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
local repository for internal use.


classRealm

protected org.codehaus.classworlds.ClassRealm classRealm
classrealm for internal use.


repositorySystem

protected org.apache.maven.repository.RepositorySystem repositorySystem

logger

protected de.saumya.mojo.ruby.Logger logger

factory

protected de.saumya.mojo.ruby.script.ScriptFactory factory
Constructor Detail

AbstractJRubyMojo

public AbstractJRubyMojo()
Method Detail

newScriptFactory

protected de.saumya.mojo.ruby.script.ScriptFactory newScriptFactory()
                                                             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

newScriptFactory

protected de.saumya.mojo.ruby.script.ScriptFactory newScriptFactory(org.apache.maven.artifact.Artifact artifact)
                                                             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

retrieveStdlibArtifact

protected org.apache.maven.artifact.Artifact retrieveStdlibArtifact()
                                                             throws org.apache.maven.artifact.DependencyResolutionRequiredException
Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

executeJRuby

protected abstract void executeJRuby()
                              throws org.apache.maven.plugin.MojoExecutionException,
                                     org.apache.maven.plugin.MojoFailureException,
                                     java.io.IOException,
                                     de.saumya.mojo.ruby.script.ScriptException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
java.io.IOException
de.saumya.mojo.ruby.script.ScriptException

launchDirectory

protected java.io.File launchDirectory()

resolveJRubyCompleteArtifact

protected org.apache.maven.artifact.Artifact resolveJRubyCompleteArtifact(java.lang.String version)
                                                                   throws org.apache.maven.artifact.DependencyResolutionRequiredException
Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException

resolveJRubyArtifact

protected org.apache.maven.artifact.Artifact resolveJRubyArtifact()
                                                           throws org.apache.maven.artifact.DependencyResolutionRequiredException,
                                                                  org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException
org.apache.maven.plugin.MojoExecutionException


Copyright © 2011. All Rights Reserved.