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

public abstract class AbstractGemMojo extends AbstractJRubyMojo
  • 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 includeOpenSSL
      Deprecated.
      flag whether to include open-ssl gem or not
      Command line -Dgem.includeOpenSSL=...
    • includeRubygemsInTestResources

      @Parameter(defaultValue="true", property="gem.includeRubygemsInTestResources") protected boolean includeRubygemsInTestResources
      flag 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 includeRubygemsInResources
      flag 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 includeProvidedRubygemsInResources
      flag 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 includeGemsInResources
      Deprecated.
      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 the includeRubygemsInResources is 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 installRDoc
      flag whether to install rdocs of the used gems or not
      Command line -Dgem.installRDoc=...
    • installRI

      @Parameter(defaultValue="false", property="gem.installRI") protected boolean installRI
      flag whether to install ri of the used gems or not
      Command line -Dgem.installRDoc=...
    • gemUseSystem

      @Parameter(defaultValue="false", property="gem.useSystem") protected boolean gemUseSystem
      use 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

      @Parameter(property="gem.homes") protected Map<String,String> 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 gemHome
      directory 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 gemPath
      directory of JRuby path to use when forking JRuby. default will be ignored when gemUseSystem is true.
      Command line -Dgem.path=...
    • binDirectory

      @Parameter(property="gem.binDirectory") protected File 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 supportNative
      Deprecated.
      flag to indicate to setup jruby's native support for C-extensions
      Command line -Dgem.supportNative=...
    • manager

      @Component protected GemManager manager
    • gemsConfig

      protected GemsConfig gemsConfig
    • gemsInstaller

      protected GemsInstaller 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:
      execute in interface org.apache.maven.plugin.Mojo
      Overrides:
      execute in class AbstractJRubyMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • newScriptFactory

      protected ScriptFactory newScriptFactory(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException
      Overrides:
      newScriptFactory in class AbstractJRubyMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • setupNativeSupport

      private File setupNativeSupport() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • gemHome

      protected File gemHome(String base, String key)
    • executeJRuby

      protected void executeJRuby() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException, IOException, ScriptException
      Specified by:
      executeJRuby in class AbstractJRubyMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
      IOException
      ScriptException
    • 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.MojoExecutionException
      ScriptException
      GemException
      IOException
      org.apache.maven.plugin.MojoFailureException
    • getRemoteRepos

      protected List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepos()