Package de.saumya.mojo.jruby
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 Summary
FieldsModifier and TypeFieldDescriptionprotected booleanadd project class path to JVM classpath on executing jruby.protected Stringcommon argumentsprivate org.sonatype.plexus.build.incremental.BuildContextprotected org.codehaus.classworlds.ClassRealmclassrealm for internal use.protected static final Stringenvironment values passed on to the jruby process.protected ScriptFactoryprotected static final Stringprotected static final Stringprotected static final Stringprotected booleanfork the JRuby execution.protected Stringjvm arguments for the java command executing jrubyprotected Stringswitches for the jruby command, like '--1.9'protected booleanverbose jruby related outputprivate Stringif 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.private JRubyVersionprivate Filethe launch directory for the JRuby execution.protected Filedirectory with ruby sources - added to ruby loadpath onlyprotected org.apache.maven.artifact.repository.ArtifactRepositorylocal repository for internal use.protected Loggerprotected org.apache.maven.project.MavenProjectreference to maven project for internal use.protected org.apache.maven.repository.RepositorySystemprotected Filedirectory with ruby sources - added to java classpath and ruby loadpathFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ScriptFactoryvoidexecute()protected abstract voidprotected Stringprotected JRubyVersionprotected Fileprivate ScriptFactoryprotected ScriptFactorynewScriptFactory(org.apache.maven.artifact.Artifact artifact) protected org.apache.maven.artifact.Artifactprivate org.apache.maven.artifact.ArtifactresolveJRubyArtifact(org.apache.maven.artifact.Artifact artifact) protected org.apache.maven.artifact.ArtifactresolveJRubyCompleteArtifact(String version) protected org.apache.maven.artifact.ArtifactresolveJRubyStdlibArtifact(org.apache.maven.artifact.Artifact jruby) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
JRUBY_COMPLETE
- See Also:
-
JRUBY_CORE
- See Also:
-
JRUBY_STDLIB
- See Also:
-
DEFAULT_JRUBY_VERSION
- See Also:
-
args
common arguments -
jrubyJvmArgs
jvm arguments for the java command executing jruby -
jrubySwitches
switches for the jruby command, like '--1.9' -
env
environment values passed on to the jruby process. needs jrubyFork true. -
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 seeDEFAULT_JRUBY_VERSION -
jrubyFork
@Parameter(property="jruby.fork", defaultValue="true") protected boolean jrubyForkfork the JRuby execution. -
jrubyVerbose
@Parameter(property="jruby.verbose", defaultValue="false") protected boolean jrubyVerboseverbose jruby related output -
rubySourceDirectory
@Parameter(property="jruby.sourceDirectory", defaultValue="src/main/ruby") protected File rubySourceDirectorydirectory with ruby sources - added to java classpath and ruby loadpath -
libDirectory
directory with ruby sources - added to ruby loadpath only -
launchDirectory
@Parameter(property="jruby.launchDirectory", defaultValue="${project.basedir}") private File launchDirectorythe launch directory for the JRuby execution. -
project
@Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject projectreference to maven project for internal use. -
addProjectClasspath
@Parameter(defaultValue="true", property="jruby.addProjectClasspath") protected boolean addProjectClasspathadd project class path to JVM classpath on executing jruby. -
localRepository
@Parameter(readonly=true, defaultValue="${localRepository}") protected org.apache.maven.artifact.repository.ArtifactRepository localRepositorylocal repository for internal use. -
classRealm
@Parameter(readonly=true, defaultValue="${dummy}") protected org.codehaus.classworlds.ClassRealm classRealmclassrealm for internal use. -
repositorySystem
@Component protected org.apache.maven.repository.RepositorySystem repositorySystem -
logger
-
factory
-
jRubyVersion
-
buildContext
@Component private org.sonatype.plexus.build.incremental.BuildContext buildContext -
eclipseWatches
-
eclipseRefresh
-
-
Constructor Details
-
AbstractJRubyMojo
public AbstractJRubyMojo()
-
-
Method Details
-
getDefaultJRubyVersion
-
getJrubyVersion
-
newScriptFactory
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createScriptFactory
- 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.MojoExecutionExceptionorg.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.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionIOExceptionScriptException
-
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.DependencyResolutionRequiredExceptionorg.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.DependencyResolutionRequiredExceptionorg.apache.maven.plugin.MojoExecutionException
-
getProjectClasspath
protected List<String> getProjectClasspath() throws org.apache.maven.artifact.DependencyResolutionRequiredException- Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException
-