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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d730f61c3fbec4cbb40c2d2d772dece10891d172
|
4
|
+
data.tar.gz: cb4aacf3dc32930cfafbc202e128e8a821474a57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f7baa869bd3cc34a27f1604cd205ca7f116ecf6ae86bd7019935950443137850b459d80b31e36d9b8fa8579f243261d2aa336812e53734ed3c1ea7a70df5ce5
|
7
|
+
data.tar.gz: 894cf492789572bba0e93fc678e7cbfe3ac878340c2c9baa5ff2c65b903ce997ab0e9b328b7645fa3b6843087c4b04ab554194a89c568adeb4e8dca941a42304
|
data/Mavenfile
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
gemfile
|
4
4
|
|
5
|
-
plugin_repository :
|
5
|
+
plugin_repository id: :maven_gems, url: 'mavengem:https://rubygems.org'
|
6
6
|
|
7
|
-
jruby_plugin(
|
7
|
+
jruby_plugin(:minitest, minispecDirectory: 'specs/*_spec.rb') do
|
8
8
|
execute_goals(:spec)
|
9
9
|
gem 'ruby-maven', '${ruby-maven.version}'
|
10
10
|
end
|
@@ -17,51 +17,47 @@ ruby_maven = gemfile_profile.dependencies.detect do |d|
|
|
17
17
|
d.artifact_id == 'ruby-maven'
|
18
18
|
end
|
19
19
|
|
20
|
-
properties(
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
'push.skip' => true )
|
20
|
+
properties('jruby.versions' => ['1.7.12', '1.7.25', '${jruby.version}'].join(','),
|
21
|
+
'jruby.modes' => ['1.9', '2.0', '2.2'].join(','),
|
22
|
+
# just lock the version
|
23
|
+
'bundler.version' => '1.10.6',
|
24
|
+
'ruby-maven.version' => ruby_maven.version,
|
25
|
+
'jruby.version' => '9.0.5.0',
|
26
|
+
'jruby.plugins.version' => '1.1.3',
|
27
|
+
'push.skip' => true)
|
29
28
|
|
30
29
|
plugin :invoker, '1.8' do
|
31
|
-
execute_goals(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
30
|
+
execute_goals(:install, :run,
|
31
|
+
id: 'integration-tests',
|
32
|
+
projectsDirectory: 'integration',
|
33
|
+
streamLogs: true,
|
34
|
+
goals: ['install'],
|
35
|
+
preBuildHookScript: 'setup.bsh',
|
36
|
+
postBuildHookScript: 'verify.bsh',
|
37
|
+
cloneProjectsTo: '${project.build.directory}',
|
38
|
+
properties: { 'jar-dependencies.version' => '${project.version}',
|
39
|
+
# use an old jruby with old ruby-maven here
|
40
|
+
'jruby.old-version' => '1.7.20',
|
41
|
+
'jruby.version' => '${jruby.version}',
|
42
|
+
'jruby.plugins.version' => '${jruby.plugins.version}',
|
43
|
+
'bundler.version' => '${bundler.version}',
|
44
|
+
'ruby-maven.version' => '${ruby-maven.version}' })
|
46
45
|
end
|
47
46
|
|
48
47
|
distribution_management do
|
49
|
-
repository :
|
48
|
+
repository id: :ossrh, url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
|
50
49
|
end
|
51
50
|
|
52
|
-
profile :
|
53
|
-
|
54
|
-
properties 'maven.test.skip' => true, 'invoker.skip' => true
|
55
|
-
|
51
|
+
profile id: :skip do
|
52
|
+
properties 'maven.test.skip' => true, 'invoker.skip' => true
|
56
53
|
end
|
57
54
|
|
58
|
-
profile :
|
55
|
+
profile id: :release do
|
59
56
|
properties 'maven.test.skip' => true, 'invoker.skip' => true, 'push.skip' => false
|
60
57
|
|
61
58
|
build do
|
62
59
|
default_goal :deploy
|
63
60
|
end
|
64
|
-
|
65
61
|
end
|
66
62
|
|
67
63
|
# vim: syntax=Ruby
|
data/Rakefile
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
#-*- mode: ruby -*-
|
2
2
|
|
3
|
-
task :
|
3
|
+
task default: [:specs]
|
4
4
|
|
5
5
|
desc 'run specs'
|
6
6
|
task :specs do
|
7
|
-
$LOAD_PATH <<
|
7
|
+
$LOAD_PATH << 'specs'
|
8
8
|
|
9
|
-
Dir['specs/*_spec.rb'].each do |f|
|
10
|
-
require File.basename(
|
9
|
+
Dir['specs/*_spec.rb'].each do |f|
|
10
|
+
require File.basename(f.sub(/.rb$/, ''))
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
task :headers do
|
15
15
|
require 'copyright_header'
|
16
16
|
|
17
|
-
s = Gem::Specification.load(
|
17
|
+
s = Gem::Specification.load(Dir['*gemspec'].first)
|
18
18
|
|
19
19
|
args = {
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
20
|
+
license: s.license,
|
21
|
+
copyright_software: s.name,
|
22
|
+
copyright_software_description: s.description,
|
23
|
+
copyright_holders: s.authors,
|
24
|
+
copyright_years: [Time.now.year],
|
25
|
+
add_path: 'lib',
|
26
|
+
output_dir: './'
|
27
27
|
}
|
28
28
|
|
29
|
-
command_line = CopyrightHeader::CommandLine.new(
|
29
|
+
command_line = CopyrightHeader::CommandLine.new(args)
|
30
30
|
command_line.execute
|
31
31
|
end
|
32
32
|
|
data/Readme.md
CHANGED
@@ -1,146 +1,147 @@
|
|
1
|
-
# jar-dependencies
|
1
|
+
# jar-dependencies
|
2
2
|
|
3
|
-
* [![Build Status](https://secure.travis-ci.org/mkristian/jar-dependencies.
|
4
|
-
* [![Code Climate](https://codeclimate.com/github/mkristian/jar-dependencies.
|
3
|
+
* [![Build Status](https://secure.travis-ci.org/mkristian/jar-dependencies.svg)](http://travis-ci.org/mkristian/jar-dependencies)
|
4
|
+
* [![Code Climate](https://codeclimate.com/github/mkristian/jar-dependencies.svg)](https://codeclimate.com/github/mkristian/jar-dependencies)
|
5
5
|
|
6
6
|
add gem dependencies for jar files to ruby gems.
|
7
7
|
|
8
8
|
|
9
|
-
##
|
9
|
+
## Getting control back over your jar
|
10
10
|
|
11
11
|
jar dependencies are declared in the gemspec of the gem using the same notation
|
12
12
|
as <https://github.com/mkristian/jbundler>.
|
13
13
|
|
14
|
-
|
14
|
+
When using `require_jar` to load the jar into JRuby's classloader a version conflict
|
15
15
|
will be detected and only **ONE** jar gets loaded.
|
16
16
|
**jbundler** allows to select the version suitable for you application.
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
Most maven-artifacts do **NOT** use versions ranges but depend on a concrete version.
|
19
|
+
In such cases **jbundler** can always **overwrite** any such version.
|
20
20
|
|
21
21
|
|
22
|
-
##
|
22
|
+
## Vendoring your jars before packing the jar
|
23
23
|
|
24
|
-
|
24
|
+
Add the following to your *Rakefile*:
|
25
25
|
|
26
26
|
require 'jars/installer'
|
27
27
|
task :install_jars do
|
28
28
|
Jars::Installer.vendor_jars!
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
file **lib/my_gem_jars.rb
|
31
|
+
This will install (download) the dependent jars into **JARS_HOME** and create a
|
32
|
+
file **lib/my_gem_jars.rb**, which will be an enumeration of `require_jars`
|
33
33
|
statements to load all the jars.
|
34
|
-
|
34
|
+
The **vendor_jars** task will copy them into the **lib** directory of the gem.
|
35
35
|
|
36
|
-
|
36
|
+
The location where jars are cached is per default **$HOME/.m2/repository** the
|
37
37
|
same default as Maven uses to cache downloaded jar-artifacts.
|
38
|
-
|
38
|
+
It respects **$HOME/.m2/settings.xml** from Maven with mirror and other settings
|
39
39
|
or the environment variable **JARS_HOME**.
|
40
40
|
|
41
|
-
**IMPORTANT**:
|
42
|
-
of your gem.
|
41
|
+
**IMPORTANT**: Make sure that jar-dependencies is only a **development dependency**
|
42
|
+
of your gem. If it is a runtime dependency the require_jars file will be overwritten
|
43
43
|
during installation.
|
44
44
|
|
45
45
|
|
46
|
-
##
|
46
|
+
## Reduce the download and reuse the jars from maven local repository
|
47
47
|
|
48
|
-
|
49
|
-
them when you install the gem.
|
48
|
+
If you do not want to vendor jars into a gem then **jar-dependency** gem can vendor
|
49
|
+
them when you install the gem. In that case do not use
|
50
50
|
`Jars::JarInstaller.install_jars` from the above rake tasks.
|
51
51
|
|
52
|
-
**NOTE**:
|
52
|
+
**NOTE**: Recent JRuby comes with **jar-dependencies** as default gem, for older
|
53
53
|
versions for the feature to work you need to gem install **jar-dependencies** first
|
54
54
|
and for bundler need to use the **bundle-with-jars** command instead.
|
55
55
|
|
56
|
-
**IMPORTANT**:
|
56
|
+
**IMPORTANT**: Make sure that jar-dependencies is a **runtime dependency** of your
|
57
57
|
gem so the require_jars file will be overwritten during installation with the
|
58
58
|
"correct" versions of the jars.
|
59
59
|
|
60
60
|
|
61
|
-
##
|
61
|
+
## For development you do not need to vendor the jars at all
|
62
62
|
|
63
|
-
|
63
|
+
Set the environment variable
|
64
64
|
|
65
65
|
export JARS_VENDOR=false
|
66
66
|
|
67
|
-
|
68
|
-
`require_jar` statements.
|
69
|
-
maven local repository and
|
67
|
+
to tell the jar_installer not vendor any jars, but only create the file with the
|
68
|
+
`require_jar` statements. This `require_jars` method will find the jar inside the
|
69
|
+
maven local repository and load it from there.
|
70
70
|
|
71
71
|
|
72
|
-
##
|
72
|
+
## Some drawbacks
|
73
73
|
|
74
|
-
*
|
75
|
-
*
|
76
|
-
*
|
74
|
+
* First you need to install the jar-dependency gem with its development dependencies installed (then ruby-maven gets installed as well)
|
75
|
+
* Bundler does not install the jar-dependencies (unless JRuby adds the gem as default gem)
|
76
|
+
* You need ruby-maven doing the job of dependency resolution and downloading them. gems not part of <http://rubygems.org> will not work currently
|
77
77
|
|
78
78
|
|
79
|
-
##
|
79
|
+
## JARs other than from maven-central
|
80
80
|
|
81
|
-
|
81
|
+
By default all jars need to come from maven-central (<search.maven.org>), in order
|
82
82
|
to use jars from any other repo you need to add it into your Maven *settings.xml*
|
83
83
|
and configure it in a way that works without an interactive prompt (username +
|
84
84
|
passwords needs to be part of the settings.xml file).
|
85
85
|
|
86
|
-
**NOTE:**
|
86
|
+
**NOTE:** Gems depending on jars other then maven-central will **NOT** work when
|
87
87
|
they get published on rubygems.org since the user of those gems will not have the
|
88
88
|
right settings.xml to allow them to access the jar dependencies.
|
89
89
|
|
90
90
|
|
91
|
-
##
|
91
|
+
## Examples
|
92
92
|
|
93
|
-
|
93
|
+
An [example with rspec and all](example/Readme.md) walks you through setup and
|
94
94
|
shows how development works and shows what happens during installation.
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
the rake-compiler in
|
96
|
+
There are some more examples with the various [project setups for gems and application](examples/README.md).
|
97
|
+
This includes using proper Maven for the project or ruby-maven with rake or
|
98
|
+
the rake-compiler in conjunction with jar-dependencies.
|
99
99
|
|
100
|
-
#
|
100
|
+
# Lock down versions
|
101
101
|
|
102
|
-
|
102
|
+
Whenever there are version ranges for jar dependencies it is advisable to lock down the versions of dependencies.
|
103
|
+
For the jar dependencies inside the gemspec declaration this can be done with:
|
103
104
|
|
104
105
|
lock_jars
|
105
106
|
|
106
|
-
|
107
|
-
jar-dependencies.
|
107
|
+
This is also working in **any** project which uses a gem with
|
108
|
+
jar-dependencies. It also uses a Jarfile if present. See the [sinatra
|
108
109
|
application from the examples](examples/sinatra-app/having-jarfile-and-gems-with-jar-dependencies/).
|
109
110
|
|
110
|
-
|
111
|
+
This means for a project using bundler and jar-dependencies the setup is
|
111
112
|
|
112
113
|
bundle install
|
113
114
|
lock_jars
|
114
115
|
|
115
|
-
|
116
|
+
This will install both gems and jars for the project.
|
116
117
|
|
117
|
-
|
118
|
+
Update a specific version is done with (use only the artifact_id)
|
118
119
|
|
119
120
|
lock_jars --update slf4j-api
|
120
121
|
|
121
|
-
|
122
|
+
And look at the dependencies tree
|
122
123
|
|
123
124
|
lock_jars --tree
|
124
125
|
|
125
|
-
|
126
|
-
|
126
|
+
As ```lock_jars``` uses ruby-maven to resolve the jar dependencies.
|
127
|
+
Since jar-dependencies does not declare ruby-maven as runtime dependency
|
127
128
|
(you just not need ruby-maven during runtime only when you want to
|
128
129
|
setup the project it is needed) it is advicable to have it as
|
129
|
-
development dependency in
|
130
|
+
development dependency in your Gemfile.
|
130
131
|
|
131
|
-
#
|
132
|
+
# Proxy and mirror setup
|
132
133
|
|
133
|
-
|
134
|
+
Proxies and mirrors can be set up by the usual configuration of maven itself: [settings.xml](https://maven.apache.org/settings.html) - see the mirrors and proxy sections.
|
134
135
|
|
135
|
-
|
136
|
+
As jar-dependencies does only deal with jar and all jars need to come from maven central, it is only neccessary to mirror maven-central. An example of such a [settings-example.xml](setting.xml is here).
|
136
137
|
|
137
|
-
|
138
|
+
You also can add such a settings.xml to your project which jar-dependencies will use instad of the default maven locations. This allows to have a per-project configuration and also removes the need to users of your Ruby project to dive into maven in case you have company policy to use a local mirror for gem and jar artifacts.
|
138
139
|
|
139
|
-
jar-dependencies itself uses maven **only** for the jars and all gems are managed by
|
140
|
+
jar-dependencies itself uses maven **only** for the jars and all gems are managed by RubyGems or Bundler or your favourite management tool. So any proxy/mirror settings which should affect gems need to be done in those tools.
|
140
141
|
|
141
|
-
#
|
142
|
+
# Gradle, Maven, etc
|
142
143
|
|
143
|
-
|
144
|
+
For dependency management frameworks like gradle (via
|
144
145
|
jruby-gradle-plugin) or maven (via jruby-maven-plugins
|
145
146
|
or jruby9-maven-plugins) or probably ivy or sbt can use the gem
|
146
147
|
artifacts from a maven repository like
|
@@ -148,71 +149,70 @@ artifacts from a maven repository like
|
|
148
149
|
or
|
149
150
|
[rubygems.lasagna.io/proxy/maven/releases](http://rubygems.lasagna.io/proxy/maven/releases/).
|
150
151
|
|
151
|
-
|
152
|
+
Each of these tools (including jar-dependencies) does the dependency
|
152
153
|
resolution slightly different and in rare cases can produce different
|
153
|
-
outcomes.
|
154
|
+
outcomes. But overall each tool can manage both jars and gems and
|
154
155
|
their transitive dependencies.
|
155
156
|
|
156
|
-
|
157
|
+
Popular gems like jrjackson or nokogiri do not declare their jars in
|
157
158
|
the gemspec files and just load the bundle jars into jruby
|
158
159
|
classloader, can easily create problems as the jackson and
|
159
|
-
xalan/xerces libraries used by those gems are popular ones in the
|
160
|
+
xalan/xerces libraries used by those gems are popular ones in the Java world.
|
160
161
|
|
161
|
-
#
|
162
|
-
|
163
|
-
since maven is used under the hood it is possible to get more insight
|
164
|
-
what maven is doing. show the regualr maven output:
|
162
|
+
# Troubleshooting
|
165
163
|
|
164
|
+
Since maven is used under the hood it is possible to get more insight
|
165
|
+
what maven is doing. Show the regular maven output:
|
166
166
|
|
167
167
|
JARS_VERBOSE=true bundle install
|
168
168
|
JARS_VERBOSE=true gem install some_gem
|
169
169
|
|
170
|
-
|
170
|
+
Or, with maven debug enabled
|
171
171
|
|
172
172
|
JARS_DEBUG=true bundle install
|
173
173
|
JARS_DEBUG=true gem install some_gem
|
174
174
|
|
175
|
-
|
175
|
+
The maven command line which gets printed needs maven-3.3.x and the
|
176
176
|
ruby DSL extension for maven:
|
177
177
|
[https://github.com/takari/polyglot-maven#configuration](polyglot-maven
|
178
178
|
configuration) where ```${maven.multiModuleProjectDirectory}``` is
|
179
179
|
your current directory.
|
180
180
|
|
181
|
-
#
|
181
|
+
# Configuration
|
182
182
|
|
183
183
|
<table border='1'>
|
184
184
|
<tr>
|
185
185
|
<td>ENV</td><td>java system property</td><td>default</td><td>description</td>
|
186
186
|
</tr>
|
187
187
|
<tr>
|
188
|
-
<td
|
188
|
+
<td><tt>JARS_DEBUG</tt></td><td>jars.debug</td><td>false</td><td>if set to true it will produce lots of debug out (maven -X switch)</td>
|
189
189
|
</tr>
|
190
190
|
<tr>
|
191
|
-
<td
|
191
|
+
<td><tt>JARS_VERBOSE</tt></td><td>jars.verbose</td><td>false</td><td>if set to true it will produce some extra output</td>
|
192
192
|
</tr>
|
193
193
|
<tr>
|
194
|
-
<td
|
194
|
+
<td><tt>JARS_HOME</tt></td><td>jars.home</td><td>$HOME/.m2/repository</td><td>filesystem location where to store the jar files and some metadata</td>
|
195
195
|
</tr>
|
196
196
|
<tr>
|
197
|
-
<td
|
197
|
+
<td><tt>JARS_MAVEN_SETTINGS</tt></td><td>jars.maven.settings</td><td>$HOME/.m2/settings.xml</td><td>setting.xml for maven to use</td>
|
198
198
|
</tr>
|
199
199
|
<tr>
|
200
|
-
<td
|
200
|
+
<td><tt>JARS_VENDOR</tt></td><td>jars.vendor</td><td>true</td><td>set to true means that the jars will be stored in JARS_HOME only</td>
|
201
201
|
</tr>
|
202
202
|
<tr>
|
203
|
-
<td
|
203
|
+
<td><tt>JARS_SKIP</tt></td><td>jars.skip</td><td>true</td><td>do **NOT** install jar dependencies at all</td>
|
204
204
|
</tr>
|
205
205
|
</table>
|
206
206
|
|
207
|
-
#
|
207
|
+
# Motivation
|
208
208
|
|
209
|
-
|
209
|
+
Just today, I stumbled across [https://github.com/arrigonialberto86/ruby-band](https://github.com/arrigonialberto86/ruby-band) which uses jbundler to manage their JAR dependencies, which happens on the first 'require "ruby-band"'. There is no easy or formal way to find out which JARs are added to jruby-classloader.
|
210
210
|
|
211
|
-
|
211
|
+
Another issue was brought to my notice yesterday [https://github.com/hqmq/derelicte/issues/1](https://github.com/hqmq/derelicte/issues/1).
|
212
212
|
|
213
|
-
|
213
|
+
Or the question of how to manage JRuby projects with maven [http://ruby.11.x6.nabble.com/Maven-dependency-management-td4996934.html](http://ruby.11.x6.nabble.com/Maven-dependency-management-td4996934.html)
|
214
214
|
|
215
|
-
|
215
|
+
Or a few days ago an issue for rake-compile [https://github.com/luislavena/rake-compiler/issues/87](https://github.com/luislavena/rake-compiler/issues/87)
|
216
216
|
|
217
|
-
|
217
|
+
With JRuby 9000 it is the right time to get jar dependencies "right" - the current situation is like the time before bundler for gems.
|
218
218
|
|
data/bin/lock_jars
CHANGED
@@ -1,49 +1,49 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'jar_dependencies'
|
3
|
-
require 'optparse'
|
4
|
-
options = {}
|
5
|
-
optparse = OptionParser.new do|opts|
|
6
|
-
|
3
|
+
require 'optparse'
|
4
|
+
options = {}
|
5
|
+
optparse = OptionParser.new do |opts|
|
7
6
|
opts.banner = "Usage: #{File.basename(__FILE__)} [options]"
|
8
7
|
|
9
|
-
opts.separator ''
|
10
|
-
opts.separator 'THIS IS A EXPERIMETAL FEATURE !!!'
|
11
|
-
opts.separator ''
|
12
|
-
opts.separator '* load jars "Jars.lock" from current working directory: `Jars.require_jars_lock!`'
|
13
|
-
opts.separator '* classpath features: see `Jars::Classpath'
|
14
8
|
opts.separator ''
|
15
9
|
opts.separator 'Options:'
|
16
10
|
opts.separator ''
|
17
11
|
|
18
|
-
opts.on(
|
12
|
+
opts.on('-v', '--verbose', 'Output more information') do |t|
|
19
13
|
options[:verbose] = t
|
20
14
|
end
|
21
15
|
|
22
|
-
opts.on(
|
16
|
+
opts.on('-d', '--debug', 'Output debug information') do |t|
|
23
17
|
options[:debug] = t
|
24
18
|
end
|
25
19
|
|
26
|
-
opts.on(
|
20
|
+
opts.on('-f', '--force', 'Force creation of Jars.lock') do |t|
|
27
21
|
options[:force] = t
|
28
22
|
end
|
29
23
|
|
30
|
-
opts.on(
|
24
|
+
opts.on('-t', '--tree', 'Show dependency tree') do |t|
|
31
25
|
options[:tree] = t
|
32
26
|
end
|
33
27
|
|
34
|
-
opts.on(
|
28
|
+
opts.on('-u', '--update JAR_COORDINATE', 'Resolves given dependency and use latest version. JAR_COORDINATE is either artifact_id or group_id:artifact_id') do |u|
|
35
29
|
options[:update] = u
|
36
30
|
end
|
37
31
|
|
38
|
-
opts.on(
|
32
|
+
opts.on('--vendor-dir DIRECTORY', 'Vendor directory where to copy the installed jars.', 'add this directory to $LOAD_PATH or set JARS_HOME respectively.') do |dir|
|
39
33
|
options[:vendor_dir] = dir
|
40
34
|
end
|
41
35
|
|
42
|
-
opts.on(
|
36
|
+
opts.on('-h', '--help', 'Display this screen') do
|
43
37
|
puts opts
|
44
38
|
exit
|
45
39
|
end
|
40
|
+
|
41
|
+
opts.separator ''
|
42
|
+
opts.separator 'THIS IS A EXPERIMETAL FEATURE !!!'
|
43
|
+
opts.separator ''
|
44
|
+
opts.separator '* load jars "Jars.lock" from current working directory: `Jars.require_jars_lock!`'
|
45
|
+
opts.separator '* classpath features: see `Jars::Classpath'
|
46
46
|
end
|
47
47
|
optparse.parse!
|
48
48
|
|
49
|
-
Jars.lock_down(
|
49
|
+
Jars.lock_down(options[:debug], options[:verbose], options)
|