Git Product home page Git Product logo

jruby-maven-plugins's Introduction

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>rubygems-release</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>de.saumya.mojo</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>de.saumya.mojo</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>de.saumya.mojo</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 :)

jruby-maven-plugins's People

Contributors

mkristian avatar bobmcwhirter avatar jcrossley3 avatar tychobrailleur avatar bbrowning avatar dobozysaurus avatar douglasrodrigo avatar markingramtrafigura avatar jkutner avatar leonidv avatar marekjelen avatar martinmcnulty avatar msrb avatar adamw avatar darmbrust avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.