Class AbstractJRubyMojo

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

public abstract class AbstractJRubyMojo extends org.apache.maven.plugin.AbstractMojo
Base for all JRuby mojos.
  • Field Details

    • JRUBY_COMPLETE

      protected static final String JRUBY_COMPLETE
      See Also:
    • JRUBY_CORE

      protected static final String JRUBY_CORE
      See Also:
    • JRUBY_STDLIB

      protected static final String JRUBY_STDLIB
      See Also:
    • DEFAULT_JRUBY_VERSION

      protected static final String DEFAULT_JRUBY_VERSION
      See Also:
    • args

      @Parameter(property="args") protected String args
      common arguments
    • jrubyJvmArgs

      @Parameter(property="jruby.jvmargs") protected String jrubyJvmArgs
      jvm arguments for the java command executing jruby
    • jrubySwitches

      @Parameter(property="jruby.switches") protected String jrubySwitches
      switches for the jruby command, like '--1.9'
    • env

      @Parameter(property="jruby.env") protected Map<String,String> env
      environment values passed on to the jruby process. needs jrubyFork true.
    • jrubyVersion

      @Parameter(property="jruby.version") private 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 see DEFAULT_JRUBY_VERSION
    • jrubyFork

      @Parameter(property="jruby.fork", defaultValue="true") protected boolean jrubyFork
      fork the JRuby execution.
    • jrubyVerbose

      @Parameter(property="jruby.verbose", defaultValue="false") protected boolean jrubyVerbose
      verbose jruby related output
    • rubySourceDirectory

      @Parameter(property="jruby.sourceDirectory", defaultValue="src/main/ruby") protected File rubySourceDirectory
      directory with ruby sources - added to java classpath and ruby loadpath
    • libDirectory

      @Parameter(property="jruby.lib", defaultValue="lib") protected File libDirectory
      directory with ruby sources - added to ruby loadpath only
    • launchDirectory

      @Parameter(property="jruby.launchDirectory", defaultValue="${project.basedir}") private File launchDirectory
      the launch directory for the JRuby execution.
    • project

      @Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject project
      reference to maven project for internal use.
    • addProjectClasspath

      @Parameter(defaultValue="true", property="jruby.addProjectClasspath") protected boolean addProjectClasspath
      add project class path to JVM classpath on executing jruby.
    • localRepository

      @Parameter(readonly=true, defaultValue="${localRepository}") protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
      local repository for internal use.
    • classRealm

      @Parameter(readonly=true, defaultValue="${dummy}") protected org.codehaus.classworlds.ClassRealm classRealm
      classrealm for internal use.
    • repositorySystem

      @Component protected org.apache.maven.repository.RepositorySystem repositorySystem
    • logger

      protected Logger logger
    • factory

      protected ScriptFactory factory
    • jRubyVersion

      private JRubyVersion jRubyVersion
    • buildContext

      @Component private org.sonatype.plexus.build.incremental.BuildContext buildContext
    • eclipseWatches

      @Parameter(property="m2e.jruby.watch") protected List<String> eclipseWatches
    • eclipseRefresh

      @Parameter(property="m2e.jruby.refresh") protected List<String> eclipseRefresh
  • Constructor Details

    • AbstractJRubyMojo

      public AbstractJRubyMojo()
  • Method Details

    • getDefaultJRubyVersion

      protected String getDefaultJRubyVersion()
    • getJrubyVersion

      protected JRubyVersion getJrubyVersion()
    • newScriptFactory

      private ScriptFactory newScriptFactory() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • createScriptFactory

      private ScriptFactory createScriptFactory() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • newScriptFactory

      protected ScriptFactory newScriptFactory(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • 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, IOException, ScriptException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
      IOException
      ScriptException
    • launchDirectory

      protected File launchDirectory()
    • resolveJRubyCompleteArtifact

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

      private org.apache.maven.artifact.Artifact resolveJRubyArtifact(org.apache.maven.artifact.Artifact artifact) 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
    • resolveJRubyStdlibArtifact

      protected org.apache.maven.artifact.Artifact resolveJRubyStdlibArtifact(org.apache.maven.artifact.Artifact jruby) throws org.apache.maven.artifact.DependencyResolutionRequiredException, org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.artifact.DependencyResolutionRequiredException
      org.apache.maven.plugin.MojoExecutionException
    • getProjectClasspath

      protected List<String> getProjectClasspath() throws org.apache.maven.artifact.DependencyResolutionRequiredException
      Throws:
      org.apache.maven.artifact.DependencyResolutionRequiredException