Project

pom-loader

0.01
No commit activity in last 3 years
No release in over 3 years
Can interpret a maven pom and pull properties and classes into context.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.3.5
~> 10.0.0
~> 2.13.0

Runtime

~> 1.5.0
 Project Readme

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