Skip to content

Instantly share code, notes, and snippets.

@justlaputa
Created October 9, 2012 15:30
Show Gist options
  • Save justlaputa/3859540 to your computer and use it in GitHub Desktop.
Save justlaputa/3859540 to your computer and use it in GitHub Desktop.
test pom file to use jruby-maven-plugin
require 'rubygems'
require 'zip/zip'
puts "hello from ruby "*20
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jl.plugin</groupId>
<artifactId>firstruby-maven-plugin</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>firstruby-maven-plugin Maven Mojo</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>rubygems-release</id>
<url>http://rubygems-proxy.torquebox.org/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>rubygems</groupId>
<artifactId>rubyzip2</artifactId>
<version>2.0.1</version>
<type>gem</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>0.29.1</version>
<executions>
<execution>
<id>test-hello-ruby</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<file>${project.build.scriptSourceDirectory}/y2p.rb</file>
<execArgs>${basedir}/src/main/resources/test.yml ${basedir}/src/main/resources</execArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>
@justlaputa
Copy link
Author

Use torquebox/jruby-maven-plugins to run ruby script from maven project.

the document on the project is not good to learn, so I created this gist. This pom can run hello.rb file successfuly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment