mguymon / lock_jar

LockJar manages Java Jars for Ruby
http://mguymon.github.io/lock_jar/
Apache License 2.0
46 stars 9 forks source link

load jars by path #12

Closed jirubio closed 10 years ago

jirubio commented 10 years ago

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.

mguymon commented 10 years ago

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.

jirubio commented 10 years ago

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.

mguymon commented 10 years ago

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

jirubio commented 10 years ago

Great! Good work, It works perfectly for me.

mguymon commented 10 years ago

:fireworks: 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.

mguymon commented 10 years ago

released as gem 0.8.0