• Stars
    star
    112
  • Rank 311,228 (Top 7 %)
  • Language
    Java
  • License
    MIT License
  • Created almost 15 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

maven plugin to handle rubygems in a maven way. including support for rspec, rails, cucumber, rake, etc

jruby maven plugins

Build Status

gem artifacts

there is maven repository with torquebox.org which delivers gem (only ruby and java platform) from rubygems.org as gem-artifacts. adding this repository to pom.xml (or settings.xml) enables maven to use gem-artifacts like this

<repositories>
  <repository>
    <id>mavengems</id>
    <url>http://rubygems-proxy.torquebox.org/releases</url>
  </repository>
</repositories>
. . .
<dependency>
  <groupId>rubygems</groupId>
  <artifactId>compass</artifactId>
  <version>0.12.2</version>
  <type>gem</type>
</dependency>

now maven will resolve the transient dependencies of the compass gem and downloads the artifact (includng the gem file) into the local repository.

the next question is how to use those artfacts:

installing gems into you project directory

just add the gem-maven-plugin in your pom and execute the 'initialize'. that will install the gem artfacts and its depdencencies into 'target/rubygems'

<build>
  <plugins>
    <plugin>
      <groupId>org.jruby.maven</groupId>
      <artifactId>gem-maven-plugin</artifactId>
      <version>${jruby.plugins.version}</version>
      <executions>
        <execution>
          <goals>
            <goal>initialize</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

the will added as test-resource in way that you can use them with ScriptingContainer (from jruby) - see src/test/java/org/example/javasass/JavaSassTest.java from integration tests.

example: execute bin/compass from the compass gem

add the following to you pom

<plugin>
  <groupId>org.jruby.maven</groupId>
  <artifactId>gem-maven-plugin</artifactId>
  <version>@project.parent.version@</version>
  <executions>
    <execution>
      <goals>
        <goal>exec</goal>
      </goals>
      <phase>compile</phase>
      <configuration>
        <execArgs>${project.build.directory}/rubygems/bin/compass compile ${basedir}/src/main/webapp/resources/sass</execArgs>
      </configuration>
    </execution>
  </executions>

this will execute compass from the compass gem during the compile phase. you can further isolate the gems by moving the dependency from root level into the plugin.

<plugin>
  <groupId>org.jruby.maven</groupId>
  <artifactId>gem-maven-plugin</artifactId>
    <version>@project.parent.version@</version>
    <executions>
      <execution>
        <goals>
          <goal>exec</goal>
        </goals>
        <phase>compile</phase>
        <configuration>
          <execArgs>${project.build.directory}/rubygems/bin/compass compile ${basedir}/src/main/webapp/resources/sass</execArgs>
        </configuration>
      </execution>
    </executions>
    <dependencies>
      <dependency>
        <groupId>rubygems</groupId>
        <artifactId>compass</artifactId>
        <version>0.12.2</version>
        <type>gem</type>
      </dependency>
    </dependencies>
  </plugin>

see also gem-maven-plugin/src/it/execute-compass-with-gems-from-plugin

more examples

for more example look into the integration test of the various plugins

running the intergration tests

mvn clean install -Pintegration-test -Pall

contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

meta-fu

enjoy :)

More Repositories

1

jruby

JRuby, an implementation of Ruby on the JVM
Ruby
3,776
star
2

warbler

Warbler chirpily constructs .war files of your Ruby applications.
Ruby
881
star
3

activerecord-jdbc-adapter

JRuby's ActiveRecord adapter using JDBC.
Ruby
462
star
4

jruby-rack

Rack for JRuby and Java appservers
Ruby
397
star
5

joni

Java port of Oniguruma regexp library
Java
166
star
6

jrubyfx

JavaFX JRuby binding
Ruby
144
star
7

jruby-lint

See how ready your Ruby code is to run on JRuby
Ruby
101
star
8

heroku-buildpack-jruby

Shell
63
star
9

jruby-ossl

DEFUNCT, new repository at:
47
star
10

jruby-openssl

JRuby's OpenSSL gem
Java
45
star
11

jruby-parser

JRuby's parser customized for IDE usage
Java
44
star
12

maven_gem

A RubyGems plugin (and a utility) to install Maven artifacts as RubyGems
Ruby
40
star
13

perfer

Ruby
31
star
14

image_voodoo

ImageScience-compatible image processing for JRuby
Ruby
26
star
15

jruby-launcher

JRuby's native launcher executable
C++
24
star
16

jcodings

Java-based codings helper classes for Joni and JRuby
Java
20
star
17

using_jruby

Code samples from the "Using JRuby" book
Ruby
19
star
18

java_inline

JVM language support for RubyInline
Ruby
19
star
19

docker-jruby

Dockerfile
18
star
20

jruby-debug

JRuby-based backend for ruby-debug
Java
15
star
21

jruby-rails-templates

App templates for JRuby on Rails applications
Ruby
14
star
22

maven-tools

ruby helpers for maven related tasks
Ruby
14
star
23

jruby-mains

a couple of main methods for embedded (j)ruby inside a jar/war file
Ruby
10
star
24

jruby-ldap

JRuby/LDAP is a native LDAP implementation that uses JNDI to implement a Ruby/LDAP compatible API.
Ruby
10
star
25

bytelist

DEPRECATED: JRuby no longer maintains org.jruby.util.ByteList as a separate library
Java
10
star
26

rubygems-servlets

webapp which hosts rubygems or a proxy to rubygems. delivers gem maven artifacts as well
Java
9
star
27

jruby-demos

Demos for JRuby presentations at conferences
Ruby
8
star
28

jruby-dashboard

A Dashing dashboard for JRuby applications.
JavaScript
8
star
29

rubybench

Ruby
7
star
30

jrubyhub

Rails 3 + JRuby open source application
Ruby
7
star
31

blog.jruby.org

This is the site and data for blog.jruby.org
CSS
7
star
32

jruby-cext

The MRI C extension subsystem for JRuby
C++
7
star
33

collateral

Public collateral for JRuby
6
star
34

jruby-examples

A collection of examples to help you get the most out of JRuby
Java
5
star
35

jruby-workshop

Course material for JRuby workshop at RubyConf AU 2013
Ruby
4
star
36

jruby-startup

A collection of utilities to help improve JRuby startup time
Ruby
4
star
37

jruby-cdc

A stripped-down version of JRuby that runs on Java ME's CDC profile
Ruby
4
star
38

jruby-graal

Java
4
star
39

jruby-visualizer

Visualize JRuby's runtime in action
Ruby
4
star
40

jrubyconf.com

JRubyConf web sites and collateral
JavaScript
3
star
41

mavengem

Mavengem protocol and mavengem wagon
Ruby
3
star
42

jay

Jay grammar/parser tool
C
2
star
43

jruby-mac-installer

Ruby
2
star
44

dbm

DBM extension for JRuby
Java
2
star
45

jruby-prism

Java parts of integrating the Prism parser into JRuby. Plugs in using an SPI
Java
2
star
46

jruby-async-profiler

A Ruby gem for JRuby that installs the JVM async-profiler extension
Ruby
1
star
47

ruby-maven

Ruby
1
star
48

jzlib

JRuby's fork of the jzlib pure-Java zlib library
Java
1
star
49

gitosis-admin

Gitosis setup for jruby.org
1
star
50

jbang-catalog

Catalog for jbang command line launcher
1
star
51

jruby-readline

JRuby's `readline` library
Java
1
star