jar-dependencies 0.3.9 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Mavenfile +29 -33
- data/Rakefile +13 -13
- data/Readme.md +79 -79
- data/bin/lock_jars +17 -17
- data/jar-dependencies.gemspec +13 -15
- data/lib/jar_dependencies.rb +107 -98
- data/lib/jars/attach_jars_pom.rb +8 -8
- data/lib/jars/classpath.rb +31 -33
- data/lib/jars/gemspec_artifacts.rb +30 -38
- data/lib/jars/gemspec_pom.rb +2 -2
- data/lib/jars/installer.rb +87 -91
- data/lib/jars/lock.rb +16 -18
- data/lib/jars/lock_down.rb +38 -39
- data/lib/jars/lock_down_pom.rb +14 -11
- data/lib/jars/maven_exec.rb +32 -32
- data/lib/jars/maven_factory.rb +49 -56
- data/lib/jars/maven_settings.rb +16 -24
- data/lib/jars/output_jars_pom.rb +2 -2
- data/lib/jars/post_install_hook.rb +2 -2
- data/lib/jars/setup.rb +1 -1
- data/lib/jars/version.rb +1 -1
- metadata +19 -10
data/lib/jars/maven_settings.rb
CHANGED
@@ -1,22 +1,16 @@
|
|
1
|
-
require 'jar_dependencies'
|
2
|
-
require 'rubygems/request'
|
3
1
|
require 'rubygems/uri_formatter'
|
4
2
|
module Jars
|
5
3
|
class MavenSettings
|
6
|
-
|
7
4
|
LINE_SEPARATOR = ENV_JAVA['line.separator']
|
8
5
|
|
9
6
|
class << self
|
10
|
-
|
11
7
|
def local_settings
|
12
8
|
unless instance_variable_defined?(:@_jars_maven_local_settings_)
|
13
9
|
@_jars_maven_local_settings_ = nil
|
14
10
|
end
|
15
11
|
if @_jars_maven_local_settings_.nil?
|
16
|
-
if settings = Jars.absolute(
|
17
|
-
if File.
|
18
|
-
@_jars_maven_local_settings_ = settings
|
19
|
-
end
|
12
|
+
if settings = Jars.absolute('settings.xml')
|
13
|
+
@_jars_maven_local_settings_ = settings if File.exist?(settings)
|
20
14
|
end
|
21
15
|
end
|
22
16
|
@_jars_maven_local_settings_ || nil
|
@@ -27,14 +21,14 @@ module Jars
|
|
27
21
|
@_jars_maven_user_settings_ = nil
|
28
22
|
end
|
29
23
|
if @_jars_maven_user_settings_.nil?
|
30
|
-
if settings = Jars.absolute(
|
31
|
-
unless File.
|
24
|
+
if settings = Jars.absolute(Jars.to_prop(MAVEN_SETTINGS))
|
25
|
+
unless File.exist?(settings)
|
32
26
|
Jars.warn { "configured ENV['#{MAVEN_SETTINGS}'] = '#{settings}' not found" }
|
33
27
|
settings = false
|
34
28
|
end
|
35
29
|
else # use maven default (user) settings
|
36
|
-
settings = File.join(
|
37
|
-
settings = false unless File.
|
30
|
+
settings = File.join(Jars.user_home, '.m2', 'settings.xml')
|
31
|
+
settings = false unless File.exist?(settings)
|
38
32
|
end
|
39
33
|
@_jars_maven_user_settings_ = settings
|
40
34
|
end
|
@@ -47,9 +41,11 @@ module Jars
|
|
47
41
|
end
|
48
42
|
if @_jars_effective_maven_settings_.nil?
|
49
43
|
begin
|
44
|
+
require 'rubygems/request'
|
45
|
+
|
50
46
|
http = Gem::Request.proxy_uri(Gem.configuration[:http_proxy] || Gem::Request.get_proxy_from_env('http'))
|
51
47
|
https = Gem::Request.proxy_uri(Gem.configuration[:https_proxy] || Gem::Request.get_proxy_from_env('https'))
|
52
|
-
rescue
|
48
|
+
rescue
|
53
49
|
Jars.debug('ignore rubygems proxy configuration as rubygems is too old')
|
54
50
|
end
|
55
51
|
if http.nil? && https.nil?
|
@@ -63,9 +59,7 @@ module Jars
|
|
63
59
|
end
|
64
60
|
|
65
61
|
def cleanup
|
66
|
-
if effective_settings != settings
|
67
|
-
File.unlink(effective_settings)
|
68
|
-
end
|
62
|
+
File.unlink(effective_settings) if effective_settings != settings
|
69
63
|
ensure
|
70
64
|
reset
|
71
65
|
end
|
@@ -78,9 +72,7 @@ module Jars
|
|
78
72
|
unless instance_variable_defined?(:@_jars_maven_settings_)
|
79
73
|
@_jars_maven_settings_ = nil
|
80
74
|
end
|
81
|
-
if @_jars_maven_settings_.nil?
|
82
|
-
local_settings || user_settings
|
83
|
-
end
|
75
|
+
local_settings || user_settings if @_jars_maven_settings_.nil?
|
84
76
|
end
|
85
77
|
|
86
78
|
def global_settings
|
@@ -88,9 +80,9 @@ module Jars
|
|
88
80
|
@_jars_maven_global_settings_ = nil
|
89
81
|
end
|
90
82
|
if @_jars_maven_global_settings_.nil?
|
91
|
-
if mvn_home = ENV[
|
92
|
-
settings = File.join(
|
93
|
-
settings = false unless File.
|
83
|
+
if mvn_home = ENV['M2_HOME'] || ENV['MAVEN_HOME']
|
84
|
+
settings = File.join(mvn_home, 'conf/settings.xml')
|
85
|
+
settings = false unless File.exist?(settings)
|
94
86
|
else
|
95
87
|
settings = false
|
96
88
|
end
|
@@ -111,7 +103,7 @@ module Jars
|
|
111
103
|
Jars.warn("can not interpolated proxy info for #{settings}")
|
112
104
|
return
|
113
105
|
else
|
114
|
-
raw.sub!(
|
106
|
+
raw.sub!('<settings>', "<settings>#{LINE_SEPARATOR}#{proxy}")
|
115
107
|
end
|
116
108
|
end
|
117
109
|
tempfile = java.io.File.create_temp_file('settings', '.xml')
|
@@ -127,7 +119,7 @@ module Jars
|
|
127
119
|
raw.sub!('__HTTP_SERVER__', http.host)
|
128
120
|
raw.sub!('__HTTP_PORT__', http.port.to_s)
|
129
121
|
else
|
130
|
-
raw.sub!('__HTTP_ACTIVE__', 'false')
|
122
|
+
raw.sub!('__HTTP_ACTIVE__', 'false')
|
131
123
|
end
|
132
124
|
if https
|
133
125
|
raw.sub!('__HTTPS_ACTIVE__', 'true')
|
data/lib/jars/output_jars_pom.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
if ENV_JAVA['jars.quiet'] != 'true'
|
4
4
|
model.dependencies.each do |d|
|
5
|
-
puts
|
6
|
-
puts
|
5
|
+
puts ' ' + d.group_id + ':' + d.artifact_id + (d.classifier ? ':' + d.classifier : '') + ':' + d.version + ':' + (d.scope || 'compile')
|
6
|
+
puts ' exclusions: ' + d.exclusions.collect { |e| e.group_id + ':' + e.artifact_id }.join unless d.exclusions.empty?
|
7
7
|
end
|
8
8
|
end
|
@@ -19,11 +19,11 @@
|
|
19
19
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
20
|
#
|
21
21
|
|
22
|
-
if defined?(
|
22
|
+
if defined?(JRUBY_VERSION) && Gem.post_install_hooks.empty?
|
23
23
|
Gem.post_install do |gem_installer|
|
24
24
|
unless (ENV['JARS_SKIP'] || ENV_JAVA['jars.skip']) == 'true'
|
25
25
|
require 'jars/installer'
|
26
|
-
jars = Jars::Installer.new(
|
26
|
+
jars = Jars::Installer.new(gem_installer.spec)
|
27
27
|
jars.ruby_maven_install_options = gem_installer.options || {}
|
28
28
|
jars.vendor_jars
|
29
29
|
end
|
data/lib/jars/setup.rb
CHANGED
data/lib/jars/version.rb
CHANGED
metadata
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jar-dependencies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- christian meier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
18
|
+
version: 5.10.0
|
19
19
|
name: minitest
|
20
20
|
prerelease: false
|
21
21
|
type: :development
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 5.10.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
@@ -52,7 +52,10 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 3.3.11
|
55
|
-
description: manage jar dependencies for gems and keep track which jar was already
|
55
|
+
description: manage jar dependencies for gems and keep track which jar was already
|
56
|
+
loaded using maven artifact coordinates. it warns on version conflicts and loads
|
57
|
+
only ONE jar assuming the first one is compatible to the second one otherwise your
|
58
|
+
project needs to lock down the right version by providing a Jars.lock file.
|
56
59
|
email:
|
57
60
|
- mkristian@web.de
|
58
61
|
executables:
|
@@ -91,10 +94,16 @@ homepage: https://github.com/mkristian/jar-dependencies
|
|
91
94
|
licenses:
|
92
95
|
- MIT
|
93
96
|
metadata: {}
|
94
|
-
post_install_message:
|
95
|
-
|
96
|
-
|
97
|
-
|
97
|
+
post_install_message: |2+
|
98
|
+
|
99
|
+
if you want to use the executable lock_jars then install ruby-maven gem before using lock_jars
|
100
|
+
|
101
|
+
$ gem install ruby-maven -v '~> 3.3.11'
|
102
|
+
|
103
|
+
or add it as a development dependency to your Gemfile
|
104
|
+
|
105
|
+
gem 'ruby-maven', '~> 3.3.11'
|
106
|
+
|
98
107
|
rdoc_options: []
|
99
108
|
require_paths:
|
100
109
|
- lib
|
@@ -110,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
119
|
version: '0'
|
111
120
|
requirements: []
|
112
121
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.6.14.1
|
114
123
|
signing_key:
|
115
124
|
specification_version: 4
|
116
125
|
summary: manage jar dependencies for gems
|