jar-dependencies 0.5.6 → 0.5.7.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Readme.md +44 -37
- data/jar-dependencies.gemspec +2 -2
- data/lib/jars/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 26162324e2f7dfeb9421f44f3e35b37b9ae2f71f3cdbaff80f6af8b3b2721a41
|
|
4
|
+
data.tar.gz: 6b7b6d1e1b65328344d8bcfadc74e3cabbb6ed5bfe77f93aaa48de75546f552a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9df51c7fc69da676da55f6d61a5ec7811dbbebd3d3de4090a9f06ceb1884c61561085ad6342914bc5a6b47f086bc94890d00d58c5b2a0ebe3ed22a553213114
|
|
7
|
+
data.tar.gz: 577861caf4c82ede39cde1d6f73bd412bddd9c0288c11e894e8a42674137b15c04d4871bfff9d9444a5aace2c89b6a40685e0ed0c05a851adf906f9b01c7378f
|
data/Readme.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# jar-dependencies
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
add gem dependencies for jar files to ruby gems.
|
|
3
|
+
[](https://rubygems.org/gems/jar-dependencies)
|
|
4
|
+
[](https://github.com/jruby/jar-dependencies/actions/workflows/main.yml?query=branch%3Amaster)
|
|
7
5
|
|
|
6
|
+
Add gem dependencies for jar files to ruby gems.
|
|
8
7
|
|
|
9
8
|
## Getting control back over your jar
|
|
10
9
|
|
|
11
10
|
jar dependencies are declared in the gemspec of the gem using the same notation
|
|
12
|
-
as
|
|
11
|
+
as [JBundler](https://github.com/jruby/jbundler).
|
|
13
12
|
|
|
14
13
|
When using `require_jar` to load the jar into JRuby's classloader a version conflict
|
|
15
14
|
will be detected and only **ONE** jar gets loaded.
|
|
@@ -23,10 +22,12 @@ In such cases **jbundler** can always **overwrite** any such version.
|
|
|
23
22
|
|
|
24
23
|
Add the following to your *Rakefile*:
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
```ruby
|
|
26
|
+
require 'jars/installer'
|
|
27
|
+
task :install_jars do
|
|
28
|
+
Jars::Installer.vendor_jars!
|
|
29
|
+
end
|
|
30
|
+
```
|
|
30
31
|
|
|
31
32
|
This will install (download) the dependent jars into **JARS_HOME** and create a
|
|
32
33
|
file **lib/my_gem_jars.rb**, which will be an enumeration of `require_jars`
|
|
@@ -62,7 +63,9 @@ gem so the require_jars file will be overwritten during installation with the
|
|
|
62
63
|
|
|
63
64
|
Set the environment variable
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
```shell
|
|
67
|
+
export JARS_VENDOR=false
|
|
68
|
+
```
|
|
66
69
|
|
|
67
70
|
to tell the jar_installer not vendor any jars, but only create the file with the
|
|
68
71
|
`require_jar` statements. This `require_jars` method will find the jar inside the
|
|
@@ -102,7 +105,9 @@ the rake-compiler in conjunction with jar-dependencies.
|
|
|
102
105
|
Whenever there are version ranges for jar dependencies it is advisable to lock down the versions of dependencies.
|
|
103
106
|
For the jar dependencies inside the gemspec declaration this can be done with:
|
|
104
107
|
|
|
105
|
-
|
|
108
|
+
```shell
|
|
109
|
+
lock_jars
|
|
110
|
+
```
|
|
106
111
|
|
|
107
112
|
This is also working in **any** project which uses a gem with
|
|
108
113
|
jar-dependencies. It also uses a Jarfile if present. See the [sinatra
|
|
@@ -110,20 +115,26 @@ application from the examples](examples/sinatra-app/having-jarfile-and-gems-with
|
|
|
110
115
|
|
|
111
116
|
This means for a project using bundler and jar-dependencies the setup is
|
|
112
117
|
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
```shell
|
|
119
|
+
bundle install
|
|
120
|
+
lock_jars
|
|
121
|
+
```
|
|
115
122
|
|
|
116
123
|
This will install both gems and jars for the project.
|
|
117
124
|
|
|
118
125
|
Update a specific version is done with (use only the artifact_id)
|
|
119
126
|
|
|
120
|
-
|
|
127
|
+
```shell
|
|
128
|
+
lock_jars --update slf4j-api
|
|
129
|
+
```
|
|
121
130
|
|
|
122
131
|
And look at the dependencies tree
|
|
123
132
|
|
|
124
|
-
|
|
133
|
+
```shell
|
|
134
|
+
lock_jars --tree
|
|
135
|
+
```
|
|
125
136
|
|
|
126
|
-
As
|
|
137
|
+
As `lock_jars` uses ruby-maven to resolve the jar dependencies.
|
|
127
138
|
Since jar-dependencies does not declare ruby-maven as runtime dependency
|
|
128
139
|
(you just not need ruby-maven during runtime only when you want to
|
|
129
140
|
setup the project it is needed) it is advicable to have it as
|
|
@@ -141,13 +152,7 @@ jar-dependencies itself uses maven **only** for the jars and all gems are manage
|
|
|
141
152
|
|
|
142
153
|
# Gradle, Maven, etc
|
|
143
154
|
|
|
144
|
-
|
|
145
|
-
jruby-gradle-plugin) or maven (via jruby-maven-plugins
|
|
146
|
-
or jruby9-maven-plugins) or probably ivy or sbt can use the gem
|
|
147
|
-
artifacts from a maven repository like
|
|
148
|
-
[rubygems-proxy from torquebox](http://rubygems-proxy.torquebox.org/)
|
|
149
|
-
or
|
|
150
|
-
[rubygems.lasagna.io/proxy/maven/releases](http://rubygems.lasagna.io/proxy/maven/releases/).
|
|
155
|
+
Dependency management frameworks like gradle (via jruby-gradle-plugin) or maven (via jruby-maven-plugins) can also use gem artifacts retrieved from rubygems.org.
|
|
151
156
|
|
|
152
157
|
Each of these tools (including jar-dependencies) does the dependency
|
|
153
158
|
resolution slightly different and in rare cases can produce different
|
|
@@ -164,18 +169,23 @@ xalan/xerces libraries used by those gems are popular ones in the Java world.
|
|
|
164
169
|
Since maven is used under the hood it is possible to get more insight
|
|
165
170
|
what maven is doing. Show the regular maven output:
|
|
166
171
|
|
|
167
|
-
|
|
168
|
-
|
|
172
|
+
```shell
|
|
173
|
+
JARS_VERBOSE=true bundle install
|
|
174
|
+
JARS_VERBOSE=true gem install some_gem
|
|
175
|
+
```
|
|
176
|
+
|
|
169
177
|
|
|
170
178
|
Or, with maven debug enabled
|
|
171
179
|
|
|
172
|
-
|
|
173
|
-
|
|
180
|
+
```shell
|
|
181
|
+
JARS_DEBUG=true bundle install
|
|
182
|
+
JARS_DEBUG=true gem install some_gem
|
|
183
|
+
```
|
|
174
184
|
|
|
175
185
|
The maven command line which gets printed needs maven-3.9.x and the
|
|
176
186
|
ruby DSL extension for maven:
|
|
177
|
-
[
|
|
178
|
-
configuration) where
|
|
187
|
+
[polyglot-maven
|
|
188
|
+
configuration](https://github.com/takari/polyglot-maven#configuration) where `${maven.multiModuleProjectDirectory}` is
|
|
179
189
|
your current directory.
|
|
180
190
|
|
|
181
191
|
# Configuration
|
|
@@ -206,15 +216,12 @@ your current directory.
|
|
|
206
216
|
|
|
207
217
|
# Motivation
|
|
208
218
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
|
|
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)
|
|
219
|
+
In 2014, while tools such as [https://github.com/arrigonialberto86/ruby-band](https://github.com/arrigonialberto86/ruby-band) used [jbundler](https://github.com/jruby/jbundler) to manage their there was no easy or formal way to
|
|
220
|
+
- find out which JARs were added to the JRuby classloader
|
|
221
|
+
- to manage JRuby projects with Maven
|
|
222
|
+
- to build Java/JRuby gem extensions with [rake-compiler](https://github.com/luislavena/rake-compiler/issues/87).
|
|
216
223
|
|
|
217
|
-
With JRuby 9000 it
|
|
224
|
+
With JRuby 9000 it was the right time to get jar dependencies "right".
|
|
218
225
|
|
|
219
226
|
# Developing
|
|
220
227
|
|
data/jar-dependencies.gemspec
CHANGED
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
|
10
10
|
s.author = 'christian meier'
|
|
11
11
|
s.email = ['mkristian@web.de']
|
|
12
12
|
s.summary = 'manage jar dependencies for gems'
|
|
13
|
-
s.homepage = 'https://github.com/
|
|
13
|
+
s.homepage = 'https://github.com/jruby/jar-dependencies'
|
|
14
14
|
|
|
15
15
|
s.bindir = 'exe'
|
|
16
16
|
s.executables = [lock_jars = 'lock_jars']
|
|
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
|
|
|
30
30
|
s.required_ruby_version = '>= 2.6'
|
|
31
31
|
|
|
32
32
|
s.add_development_dependency 'minitest', '~> 5.10'
|
|
33
|
-
s.
|
|
33
|
+
s.add_development_dependency 'ruby-maven', ruby_maven_version = '~> 3.9'
|
|
34
34
|
|
|
35
35
|
s.post_install_message = <<~TEXT
|
|
36
36
|
|
data/lib/jars/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jar-dependencies
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.7.pre1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- christian meier
|
|
@@ -30,7 +30,7 @@ dependencies:
|
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
32
|
version: '3.9'
|
|
33
|
-
type: :
|
|
33
|
+
type: :development
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
@@ -76,7 +76,7 @@ files:
|
|
|
76
76
|
- lib/jars/setup.rb
|
|
77
77
|
- lib/jars/version.rb
|
|
78
78
|
- lib/rubygems_plugin.rb
|
|
79
|
-
homepage: https://github.com/
|
|
79
|
+
homepage: https://github.com/jruby/jar-dependencies
|
|
80
80
|
licenses:
|
|
81
81
|
- MIT
|
|
82
82
|
metadata:
|