mguymon / lock_jar

LockJar manages Java Jars for Ruby

Home Page:http://mguymon.github.io/lock_jar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

load jars by path

jirubio opened this issue · comments

It would be great to load internal jars by setting it's path.
Example JarFile:
jar 'lib/library_name.jar'

Setting the groupid:artifactid:version nomenclature is nice for loading external jars located in maven repositories, but there is not a way to load jars developed by you.
Looking at naether I think path jars are supported.
At the moment I use Lockjar for loading external jars and manual require for locally stored jars. I'm using JRuby.

There is a placeholder in LockJar for "local" jars:

local 'lib/library_name.jar'

The goal is that they are added to a local workspace in the Aether, so the local jars will join the dependency resolution. If nothing else, local jars could be automatically added to the classpath.

Hi,
Viewing the dsl code I found this:

      def local( *args )
        if !args.empty? && File.directory?( File.expand_path( args.first ) )
          warn "[DEPRECATION] `local` to set local_repository is deprecated.  Please use `local_repo` instead."
          local_repo(args.first)
        else
          # XXX: support local artifacts
        end
      end

I guess this is not implemented. I will try to execute the code later to verify this, I can't right now.

Yeah, that is the placeholder. I have a new branch up for adding the local jar support if you want to check it out: https://github.com/mguymon/lock_jar/tree/local_jar

Great! Good work, It works perfectly for me.

🎆 w00t

I will kick the tires some more than push out a new gem.

The one additional feature that I would like to add is the ability to map the maven coordinates (such as nather:core:0.13.1) to a local jar and have the local jar join in the dependency resolution in Aether. Then when the dependencies are figured out, the path for the nather:core:0.13.1 will point at the local jar path instead of a path in the maven repo.

released as gem 0.8.0