Skip to content

Simplify working with java dependencies from a ruby project.

License

Notifications You must be signed in to change notification settings

homeaway/pom-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PomLoader - A Maven Pom Loader

Simplify working with java dependencies.

You need to meet the following requirements:

  1. Running with jruby
  2. Mavenized Project

HOWTO

  • Specify your java dependencies in a pom.xml (same as you would a java maven project)
  • Add the following lines to an intializer or spec_helper
  • Smile because your java dependencies are loaded onto your classpath when you start your app

Install

gem install pom-loader

Usage

require 'pom-loader'
pom_dir = File.expand_path("../../", __FILE__)  # The dir that contains your pom.xml file
mvn = ENV['MVN2_EXE'] || 'mvn'                  # Your maven executable
PomLoader.load(pom_dir: pom_dir, mvn_exe: mvn)
$! = nil                                        # unset evil magic bit

-- PomLoader will cause the ruby process to:

  1. parse the pom.xml file
  2. figure out and load all jar dependencies.
  3. Setup the log4j context if target/classes/com/homeaway/log4j.xml exists
  4. Setup Java system properties for every property parsed from the jetty plugin system properties.

Adding the Rake Task

We've provided a rake task that will gather/install all of your java dependencies for your jruby project. Inside of your project's rakefile simply add:

require 'pom-loader/tasks'

And now when you 'rake -T' you should see:

...
rake pom_loader:load      # Generate and gather all of the files required for PomLoader
...

License

Apache License version 2.0

About

Simplify working with java dependencies from a ruby project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages