Skip to content

Commit 95866a9

Browse files
authored
Pin jar-dependencies to match jruby 9.4.13.0 (#17787)
* Pin jar-dependencies to match jruby 9.4.13.0 When default and bundler dont agree we can see errors about activated versions. * Revert "fix jars installer for new maven and pin psych to 5.2.2 (#16919)" This reverts commit 52b7fb0.
1 parent 9c5092d commit 95866a9

File tree

3 files changed

+2
-30
lines changed

3 files changed

+2
-30
lines changed

Gemfile.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ gem "murmurhash3", "= 0.1.6" # Pins until version 0.1.7-java is released
4242
gem "date", "= 3.3.3"
4343
gem "thwait"
4444
gem "bigdecimal", "~> 3.1"
45+
gem "jar-dependencies", "= 0.5.4" # Pin to avoid conflict with default

lib/bootstrap/bundler.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
# work around https://github.com/jruby/jruby/issues/8579
19-
require_relative './patches/jar_dependencies'
20-
2118
module LogStash
2219
module Bundler
2320
extend self

lib/bootstrap/patches/jar_dependencies.rb

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,11 @@ def require_jar(*args)
2121
return nil unless Jars.require?
2222
result = Jars.require_jar(*args)
2323
if result.is_a? String
24-
# JARS_VERBOSE=true will show these
24+
# JAR_DEBUG=1 will now show theses
2525
Jars.debug { "--- jar coordinate #{args[0..-2].join(':')} already loaded with version #{result} - omit version #{args[-1]}" }
2626
Jars.debug { " try to load from #{caller.join("\n\t")}" }
2727
return false
2828
end
2929
Jars.debug { " register #{args.inspect} - #{result == true}" }
3030
result
3131
end
32-
33-
# work around https://github.com/jruby/jruby/issues/8579
34-
# the ruby maven 3.9.3 + maven-libs 3.9.9 gems will output unnecessary text we need to trim down during `load_from_maven`
35-
# remove everything from "--" until the end of the line
36-
# the `[...-5]` is just to remove the color changing characters from the end of the string that exist before "--"
37-
require 'jars/installer'
38-
39-
class ::Jars::Installer
40-
def self.load_from_maven(file)
41-
Jars.debug { "[load_from_maven] called with arguments: #{file.inspect}" }
42-
result = []
43-
::File.read(file).each_line do |line|
44-
if line.match?(/ --/)
45-
Jars.debug { "[load_from_maven] line: #{line.inspect}" }
46-
fixed_line = line.strip.gsub(/ --.+?$/, "")[0...-5]
47-
Jars.debug { "[load_from_maven] fixed_line: #{fixed_line.inspect}" }
48-
dep = ::Jars::Installer::Dependency.new(fixed_line)
49-
else
50-
dep = ::Jars::Installer::Dependency.new(line)
51-
end
52-
result << dep if dep && dep.scope == :runtime
53-
end
54-
Jars.debug { "[load_from_maven] returned: #{result.inspect}" }
55-
result
56-
end
57-
end

0 commit comments

Comments
 (0)