Package de.saumya.mojo.gem
Class AbstractGemMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
de.saumya.mojo.jruby.AbstractJRubyMojo
de.saumya.mojo.gem.AbstractGemMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractTestMojo,ExecMojo,GemifyMojo,GemMojo,GenerateResourcesMojo,InitializeMojo,InstallMojo,PackageMojo,ProcessResourcesMojo,PushMojo,SetsMojo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Filedirectory of JRuby bin path to use when forking JRuby.protected Filedirectory of gem home to use when forking JRuby.map different install locations for rubygems (GEM_HOME) to a directory.protected Filedirectory of JRuby path to use when forking JRuby.protected GemsConfigprotected GemsInstallerprotected booleanuse system gems instead of setting up GemPath/GemHome inside the build directory and ignores any set gemHome and gemPath.protected StringDeprecated.protected boolean/** flag whether to include file under the lib directory
Command line -Dgem.includeLibDirectoryInResources=...protected booleanDeprecated.protected booleanflag whether to include all gems to resources, i.e.protected booleanflag whether to include all gems to resources, i.e.protected booleanflag whether to include all gems to test-resources, i.e.protected booleanflag whether to install rdocs of the used gems or not
Command line -Dgem.installRDoc=...protected booleanflag whether to install ri of the used gems or not
Command line -Dgem.installRDoc=...protected GemManagerprotected org.apache.maven.plugin.descriptor.PluginDescriptorprotected booleanDeprecated.protected org.codehaus.plexus.archiver.UnArchiverFields inherited from class de.saumya.mojo.jruby.AbstractJRubyMojo
addProjectClasspath, args, classRealm, DEFAULT_JRUBY_VERSION, eclipseRefresh, eclipseWatches, env, factory, JRUBY_COMPLETE, JRUBY_CORE, JRUBY_STDLIB, jrubyFork, jrubyJvmArgs, jrubySwitches, jrubyVerbose, libDirectory, localRepository, logger, project, repositorySystem, rubySourceDirectoryFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddResource(List<org.apache.maven.model.Resource> resources, org.apache.maven.model.Resource resource) voidexecute()protected voidprotected abstract voidprotected Fileprotected List<org.apache.maven.artifact.repository.ArtifactRepository>protected ScriptFactorynewScriptFactory(org.apache.maven.artifact.Artifact artifact) private FileMethods inherited from class de.saumya.mojo.jruby.AbstractJRubyMojo
getDefaultJRubyVersion, getJrubyVersion, getProjectClasspath, launchDirectory, resolveJRubyArtifact, resolveJRubyCompleteArtifact, resolveJRubyStdlibArtifactMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
unzip
@Component(hint="zip") protected org.codehaus.plexus.archiver.UnArchiver unzip -
plugin
@Parameter(defaultValue="${plugin}", readonly=true) protected org.apache.maven.plugin.descriptor.PluginDescriptor plugin -
includeOpenSSL
@Parameter(defaultValue="false", property="gem.includeOpenSSL") @Deprecated protected boolean includeOpenSSLDeprecated.flag whether to include open-ssl gem or not
Command line -Dgem.includeOpenSSL=... -
includeRubygemsInTestResources
@Parameter(defaultValue="true", property="gem.includeRubygemsInTestResources") protected boolean includeRubygemsInTestResourcesflag whether to include all gems to test-resources, i.e. to test-classpath or not
Command line -Dgem.includeRubygemsInTestResources=... -
includeRubygemsInResources
@Parameter(defaultValue="false", property="gem.includeRubygemsInResources") protected boolean includeRubygemsInResourcesflag whether to include all gems to resources, i.e. to classpath or not
Command line -Dgem.includeRubygemsInResources=... -
includeProvidedRubygemsInResources
@Parameter(defaultValue="false", property="gem.includeProvidedRubygemsInResources") protected boolean includeProvidedRubygemsInResourcesflag whether to include all gems to resources, i.e. to classpath or not
Command line -Dgem.includeProvidedRubygemsInResources=... -
includeGemsInResources
@Parameter(property="gem.includeGemsInResources") @Deprecated protected String includeGemsInResourcesDeprecated.EXPERIMENTAL this gives the scope of the gems which shall be included to resources. flag whether to include all gems to resources, i.e. to classpath or not. the difference to theincludeRubygemsInResourcesis that it does not depend on rubygems during runtime since the required_path of the gems gets added to resources. note that it expect the required_path of the gem to be lib which is the default BUT that is not true for all gems. in this sense this feature is incomplete and might not work for you !!! IMPORTANT: it only adds the gems with provided scope since they are packed with the jar and then the pom.xml will not have them (since they are marked 'provided') as transitive dependencies. this feature can be helpful in situations where the classloader does not work for rubygems due to rubygems uses file system globs to find the gems and this only works if the classloader reveals the jar url of its jars (i.e. URLClassLoader). for example OSGi classloader can not work with rubygems !!
Command line -Dgem.includeGemsInResources=... -
includeLibDirectoryInResources
@Parameter(defaultValue="false", property="gem.includeLibDirectoryInResources") protected boolean includeLibDirectoryInResources/** flag whether to include file under the lib directory
Command line -Dgem.includeLibDirectoryInResources=... -
installRDoc
@Parameter(defaultValue="false", property="gem.installRDoc") protected boolean installRDocflag whether to install rdocs of the used gems or not
Command line -Dgem.installRDoc=... -
installRI
@Parameter(defaultValue="false", property="gem.installRI") protected boolean installRIflag whether to install ri of the used gems or not
Command line -Dgem.installRDoc=... -
gemUseSystem
@Parameter(defaultValue="false", property="gem.useSystem") protected boolean gemUseSystemuse system gems instead of setting up GemPath/GemHome inside the build directory and ignores any set gemHome and gemPath. you need to have both GEM_HOME and GEM_PATH environment variable set to make it work.
Command line -Dgem.useSystem=... -
gemHomes
map different install locations for rubygems (GEM_HOME) to a directory. for example compile dependencies will be installed in ${project.build.directory}/rubygems and provided dependencies in ${project.build.directory}/rubygems-provided, and ${project.build.directory}/rubygems-test for the test scope. this mapping here allows to map those different directories onto a single one, i.e.: test => ${gem.home}, provided => ${gem.home} -
gemHome
@Parameter(property="gem.home", defaultValue="${project.build.directory}/rubygems") protected File gemHomedirectory of gem home to use when forking JRuby. default will be ignored when gemUseSystem is true.
Command line -Dgem.home=... -
gemPath
@Parameter(property="gem.path", defaultValue="${project.build.directory}/rubygems") protected File gemPathdirectory of JRuby path to use when forking JRuby. default will be ignored when gemUseSystem is true.
Command line -Dgem.path=... -
binDirectory
directory of JRuby bin path to use when forking JRuby.
Command line -Dgem.binDirectory=... -
supportNative
@Parameter(defaultValue="false", property="gem.supportNative") @Deprecated protected boolean supportNativeDeprecated.flag to indicate to setup jruby's native support for C-extensions
Command line -Dgem.supportNative=... -
manager
-
gemsConfig
-
gemsInstaller
-
-
Constructor Details
-
AbstractGemMojo
public AbstractGemMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Overrides:
executein classAbstractJRubyMojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
newScriptFactory
protected ScriptFactory newScriptFactory(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException - Overrides:
newScriptFactoryin classAbstractJRubyMojo- Throws:
org.apache.maven.plugin.MojoExecutionException
-
setupNativeSupport
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
gemHome
-
executeJRuby
protected void executeJRuby() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException, IOException, ScriptException- Specified by:
executeJRubyin classAbstractJRubyMojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionIOExceptionScriptException
-
addResource
protected void addResource(List<org.apache.maven.model.Resource> resources, org.apache.maven.model.Resource resource) -
executeWithGems
protected abstract void executeWithGems() throws org.apache.maven.plugin.MojoExecutionException, ScriptException, GemException, IOException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionScriptExceptionGemExceptionIOExceptionorg.apache.maven.plugin.MojoFailureException
-
getRemoteRepos
-