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  org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
          artifact factory for internal use.
protected  Set<org.apache.maven.artifact.Artifact> artifacts
          The project's artifacts.
protected  org.apache.maven.project.MavenProjectBuilder builder
           
protected  org.codehaus.classworlds.ClassRealm classRealm
          classrealm for internal use.
protected  boolean fork
          fork the JRuby execution.
protected  File gemHome
          directory of gem home to use when forking JRuby.
protected  File gemPath
          directory of JRuby path to use when forking JRuby.
protected  File home
          directory of JRuby home to use when forking JRuby.
protected  File launchDirectory
          the launch directory for the JRuby execution.
protected  String launchMemory
          The amount of memory to use when forking JRuby.
protected  org.apache.maven.artifact.repository.ArtifactRepository localRepository
          local repository for internal use.
protected  org.apache.maven.artifact.metadata.ArtifactMetadataSource metadata
           
protected  File outputDirectory
          output directory for internal use.
protected  File outputFile
          output file where the stdout will be redirected to
protected  org.apache.maven.project.MavenProject project
          reference to maven project for internal use.
protected  List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
          list of remote repositories for internal use.
protected  org.apache.maven.artifact.resolver.ArtifactResolver resolver
          artifact resolver for internal use.
protected  boolean verbose
          verbose jruby related output
protected  String version
          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.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractJRubyMojo()
           
 
Method Summary
protected  File binDirectory()
           
protected  StringBuilder binScript(String script)
           
protected  void execute(String args)
           
protected  void execute(String[] args)
           
protected  void execute(String[] args, File outputFile)
           
protected  void execute(String[] args, File outputFile, boolean resolveArtifacts)
           
protected  void execute(String args, boolean resolveArtifacts)
           
protected  void execute(String args, boolean resolveArtifacts, Map<String,String> env)
           
protected  void executeScript(File script, String args, boolean resolveArtifacts, Map<String,String> env)
           
protected  String fileFromClassloader(String file)
           
protected  File launchDirectory()
           
protected  org.apache.maven.artifact.Artifact resolveJRUBYCompleteArtifact()
           
protected  void resolveTransitively(Collection<org.apache.maven.artifact.Artifact> artifacts, org.apache.maven.artifact.Artifact artifact)
           
protected  Map<String,String> setupEnv()
           
protected  void setupEnv(Map<String,String> env)
           
 
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
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

fork

protected boolean fork
fork the JRuby execution.


verbose

protected boolean verbose
verbose jruby related output


launchDirectory

protected File launchDirectory
the launch directory for the JRuby execution.


home

protected File home
directory of JRuby home to use when forking JRuby.


gemHome

protected File gemHome
directory of gem home to use when forking JRuby.


gemPath

protected File gemPath
directory of JRuby path to use when forking JRuby.


launchMemory

protected String launchMemory
The amount of memory to use when forking JRuby.


project

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


artifacts

protected Set<org.apache.maven.artifact.Artifact> artifacts
The project's artifacts.


artifactFactory

protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
artifact factory for internal use.


resolver

protected org.apache.maven.artifact.resolver.ArtifactResolver resolver
artifact resolver for internal use.


localRepository

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


remoteRepositories

protected List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
list of remote repositories for internal use.


version

protected String version
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. defaults to "1.4.1".


outputFile

protected File outputFile
output file where the stdout will be redirected to


outputDirectory

protected File outputDirectory
output directory for internal use.


classRealm

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


metadata

protected org.apache.maven.artifact.metadata.ArtifactMetadataSource metadata

builder

protected org.apache.maven.project.MavenProjectBuilder builder
Constructor Detail

AbstractJRubyMojo

public AbstractJRubyMojo()
Method Detail

resolveJRUBYCompleteArtifact

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

launchDirectory

protected File launchDirectory()

execute

protected void execute(String args,
                       boolean resolveArtifacts)
                throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

executeScript

protected void executeScript(File script,
                             String args,
                             boolean resolveArtifacts,
                             Map<String,String> env)
                      throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

execute

protected void execute(String args,
                       boolean resolveArtifacts,
                       Map<String,String> env)
                throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

execute

protected void execute(String args)
                throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

execute

protected void execute(String[] args)
                throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

execute

protected void execute(String[] args,
                       File outputFile)
                throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

execute

protected void execute(String[] args,
                       File outputFile,
                       boolean resolveArtifacts)
                throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

setupEnv

protected Map<String,String> setupEnv()

setupEnv

protected void setupEnv(Map<String,String> env)

resolveTransitively

protected void resolveTransitively(Collection<org.apache.maven.artifact.Artifact> artifacts,
                                   org.apache.maven.artifact.Artifact artifact)
                            throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

fileFromClassloader

protected String fileFromClassloader(String file)

binDirectory

protected File binDirectory()

binScript

protected StringBuilder binScript(String script)


Copyright © 2010. All Rights Reserved.