jar-dependencies 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53767c5745bde116c2f6cbf6b4c44247590ddfdb
4
- data.tar.gz: d6bded82c09871123d5782102b1b6116bbd922fe
3
+ metadata.gz: 9b5ca03580773f81be7b901142b450a339ff44e8
4
+ data.tar.gz: 1dd1e49ac644f249edb809e46711d0c284491b4c
5
5
  SHA512:
6
- metadata.gz: 33c19ed63947debdc596d5323baaba1a0c47888f0a9263ed6ef882496f312c627e95b7b5b04a1be1f7fc7c811823d803b532414db1b95a4a613bdd8a7f0d53f8
7
- data.tar.gz: fd02f03753fe532f4289aa44f93678bbaf0428451b45b1c691ae7fd504f2fbaf0ed07fc3db3f323c06c7325a115a8bdd8361fe99dab3f93e5964eb330b2f7390
6
+ metadata.gz: 2d72c2b427e7b4a207d3ad6555252999b8634a2c892eab21b0b3c32037ef5a6b57acec243eafc649c386931c8e3b5c237ab488abfb917c725cc67fa9968285be
7
+ data.tar.gz: 4771ea73f136626e720d7bbc7513d1a9e04f90129bd769505b61616d6134b87a2b5571f78e0c54dc07b9262853977250ad98ae2956584b7be8bff3e85cf4fb5a
@@ -121,6 +121,14 @@ module Jars
121
121
  to_prop( LOCK ) || 'Jars.lock'
122
122
  end
123
123
 
124
+ def jars_lock_from_class_loader
125
+ if to_prop( LOCK ).nil? && defined?(JRUBY_VERSION)
126
+ JRuby.runtime.jruby_class_loader.get_resources( 'Jars.lock' ).collect do |url|
127
+ url.to_s
128
+ end
129
+ end
130
+ end
131
+
124
132
  def lock_path( basedir = nil )
125
133
  deps = self.lock
126
134
  return deps if File.exists?( deps )
@@ -177,15 +185,35 @@ module Jars
177
185
  @_jars_maven_global_settings_ || nil
178
186
  end
179
187
 
188
+ def local_maven_repo
189
+ @_local_maven_repo ||= detect_local_repository(maven_user_settings) ||
190
+ detect_local_repository(maven_global_settings) ||
191
+ File.join( user_home, '.m2', 'repository' )
192
+ end
193
+
180
194
  def home
181
- @_jars_home_ ||= absolute(to_prop(HOME)) ||
182
- detect_local_repository(maven_user_settings) ||
183
- detect_local_repository(maven_global_settings) ||
184
- File.join( user_home, '.m2', 'repository' )
195
+ @_jars_home_ ||= absolute(to_prop(HOME)) || local_maven_repo
185
196
  end
186
197
 
187
198
  def require_jars_lock!( scope = :runtime )
188
- if jars_lock = Jars.lock_path
199
+ urls = jars_lock_from_class_loader
200
+ if urls and urls.size > 0
201
+ @@jars_lock = true
202
+ # funny error during spec where it tries to load it again
203
+ # and finds it as gem instead of the LOAD_PATH
204
+ require 'jars/classpath' unless defined? Jars::Classpath
205
+ done = []
206
+ while done != urls do
207
+ urls.each do |url|
208
+ unless done.member?( url )
209
+ classpath = Jars::Classpath.new( nil, "uri:#{url}" )
210
+ classpath.require( scope )
211
+ done << url
212
+ end
213
+ end
214
+ urls = jars_lock_from_class_loader
215
+ end
216
+ elsif jars_lock = Jars.lock_path
189
217
  @@jars_lock = jars_lock
190
218
  # funny error during spec where it tries to load it again
191
219
  # and finds it as gem instead of the LOAD_PATH
@@ -80,7 +80,7 @@ module Jars
80
80
  out = File.expand_path( '.jars.output' )
81
81
  tree = File.expand_path( '.jars.tree' )
82
82
  maven.property( 'jars.outputFile', out )
83
- maven.property( 'maven.repo.local', Jars.home )
83
+ maven.property( 'maven.repo.local', Jars.local_maven_repo )
84
84
  maven.property( 'jars.home', vendor_dir ) if vendor_dir
85
85
  maven.property( 'jars.lock', File.expand_path( Jars.lock ) )
86
86
  maven.property( 'jars.force', options[ :force ] == true )
@@ -1,12 +1,6 @@
1
1
  # this file is maven DSL and used by maven via jars/executor.rb
2
2
 
3
- bdir = ENV_JAVA[ "jars.basedir" ]
4
-
5
- basedir( bdir )
6
- if basedir != bdir
7
- # older maven-tools needs this
8
- self.instance_variable_set( :@basedir, bdir )
9
- end
3
+ basedir( ENV_JAVA[ "jars.basedir" ] )
10
4
 
11
5
  ( 0..10000 ).each do |i|
12
6
  coord = ENV_JAVA[ "jars.#{i}" ]
@@ -1,5 +1,5 @@
1
1
  module Jars
2
- VERSION = '0.2.3'.freeze
3
- JRUBY_PLUGINS_VERSION = '1.1.2'.freeze
2
+ VERSION = '0.2.4'.freeze
3
+ JRUBY_PLUGINS_VERSION = '1.1.3'.freeze
4
4
  DEPENDENCY_PLUGIN_VERSION = '2.8'.freeze
5
5
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jar-dependencies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian meier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-22 00:00:00.000000000 Z
11
+ date: 2015-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: minitest
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '5.3'
20
14
  requirement: !ruby/object:Gem::Requirement
21
15
  requirements:
22
16
  - - "~>"
23
17
  - !ruby/object:Gem::Version
24
18
  version: '5.3'
19
+ name: minitest
25
20
  prerelease: false
26
21
  type: :development
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
24
  - - "~>"
32
25
  - !ruby/object:Gem::Version
33
- version: '10.2'
26
+ version: '5.3'
27
+ - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
36
30
  - - "~>"
37
31
  - !ruby/object:Gem::Version
38
32
  version: '10.2'
33
+ name: rake
39
34
  prerelease: false
40
35
  type: :development
41
- - !ruby/object:Gem::Dependency
42
- name: ruby-maven
43
36
  version_requirements: !ruby/object:Gem::Requirement
44
37
  requirements:
45
38
  - - "~>"
46
39
  - !ruby/object:Gem::Version
47
- version: 3.3.3
40
+ version: '10.2'
41
+ - !ruby/object:Gem::Dependency
48
42
  requirement: !ruby/object:Gem::Requirement
49
43
  requirements:
50
44
  - - "~>"
51
45
  - !ruby/object:Gem::Version
52
46
  version: 3.3.3
47
+ name: ruby-maven
53
48
  prerelease: false
54
49
  type: :development
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.3.3
55
55
  description: manage jar dependencies for gems and keep track which jar was already loaded using maven artifact coordinates. it warns on version conflicts and loads only ONE jar assuming the first one is compatible to the second one otherwise your project needs to lock down the right version by providing a Jars.lock file.
56
56
  email:
57
57
  - mkristian@web.de