manticore icon indicating copy to clipboard operation
manticore copied to clipboard

Release 0.9.2 ships with older httpclient jars

Open jsvd opened this issue 1 month ago • 0 comments

❯ gem fetch manticore
Fetching manticore-0.9.2-java.gem
Downloaded manticore-0.9.2-java

❯ gem unpack manticore-0.9.2-java.gem
Unpacked gem: 'manticore-0.9.2-java'

❯ find manticore-0.9.2-java -name "*.jar"
manticore-0.9.2-java/lib/commons-codec/commons-codec/1.15/commons-codec-1.15.jar
manticore-0.9.2-java/lib/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
manticore-0.9.2-java/lib/org/manticore/manticore-ext.jar
manticore-0.9.2-java/lib/org/apache/httpcomponents/httpcore/4.4.14/httpcore-4.4.14.jar
manticore-0.9.2-java/lib/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar
manticore-0.9.2-java/lib/org/apache/httpcomponents/httpmime/4.5.13/httpmime-4.5.13.jar

manticore/ ❯ grep jar manticore.gemspec
  spec.add_development_dependency "jar-dependencies", "~> 0.5"
  spec.requirements << "jar org.apache.httpcomponents:httpclient, '~> 4.5.14'"
  spec.requirements << "jar org.apache.httpcomponents:httpmime,   '~> 4.5.14'"
  spec.requirements << "jar commons-logging:commons-logging,      '~> 1.2'"
  spec.requirements << "jar commons-codec:commons-codec,          '~> 1.11'"
  spec.requirements << "jar org.apache.httpcomponents:httpcore,   '~> 4.4.16'"

It seems that rake install_jars was missed, using the older files on disk. Also this task now fails due to an issue in jar-dependencies 0.4.x: https://github.com/jruby/jar-dependencies/issues/92, fixed in 0.5.4 by https://github.com/jruby/jar-dependencies/pull/93:

Before:

❯ bundle exec rake install_jars
  jar dependencies for manticore-0.9.2-java.gemspec . . .
Installing gem 'ruby-maven' . . .
Fetching ruby-maven-3.9.3.gem

using maven for the first time results in maven
downloading all its default plugin and can take time.
as those plugins get cached on disk and further execution
of maven is much faster then the first time.

      org.apache.httpcomponents:httpclient:[4.5.14,4.5.99999]:compile
      org.apache.httpcomponents:httpmime:[4.5.14,4.5.99999]:compile
      commons-logging:commons-logging:[1.2,1.99999]:compile
      commons-codec:commons-codec:[1.11,1.99999]:compile
      org.apache.httpcomponents:httpcore:[4.4.16,4.4.99999]:compile
rake aborted!
Errno::ENOENT: No such file or directory - .m2/repository/org/apache/httpcomponents/httpclient/4.5.14/httpclient-4.5.14.jar -- module org.apache.httpcomponents.httpclient [auto]
.rvm/gems/jruby-9.4.9.0/gems/jar-dependencies-0.4.1/lib/jars/installer.rb:92:in `vendor_file'
.rvm/gems/jruby-9.4.9.0/gems/jar-dependencies-0.4.1/lib/jars/installer.rb:151:in `block in vendor_jars'
.rvm/gems/jruby-9.4.9.0/gems/jar-dependencies-0.4.1/lib/jars/installer.rb:150:in `vendor_jars'
.rvm/gems/jruby-9.4.9.0/gems/jar-dependencies-0.4.1/lib/jars/installer.rb:226:in `do_install'
.rvm/gems/jruby-9.4.9.0/gems/jar-dependencies-0.4.1/lib/jars/installer.rb:179:in `vendor_jars!'
.rvm/gems/jruby-9.4.9.0/gems/jar-dependencies-0.4.1/lib/jars/installer.rb:174:in `vendor_jars!'
projects/manticore/Rakefile:13:in `block in <main>'
org/jruby/ext/monitor/Monitor.java:82:in `synchronize'
.rvm/gems/jruby-9.4.9.0/gems/rake-13.3.0/exe/rake:27:in `<main>'
.rvm/gems/jruby-9.4.9.0/bin/jruby_executable_hooks:22:in `<main>'
Tasks: TOP => install_jars
(See full trace by running task with --trace)

After:

diff --git a/manticore.gemspec b/manticore.gemspec
index 77a3a1e..89847c6 100644
--- a/manticore.gemspec
+++ b/manticore.gemspec
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|

   spec.add_dependency "openssl_pkcs8_pure"

-  spec.add_development_dependency "jar-dependencies", "~> 0.4.1"
+  spec.add_development_dependency "jar-dependencies", "~> 0.5"

   spec.requirements << "jar org.apache.httpcomponents:httpclient, '~> 4.5.14'"
   spec.requirements << "jar org.apache.httpcomponents:httpmime,   '~> 4.5.14'"

It works (also requires a more recent JRuby):

❯ bundle exec rake install_jars
  jar dependencies for manticore-0.9.2-java.gemspec . . .
Installing gem 'ruby-maven' . . .

using maven for the first time results in maven
downloading all its default plugin and can take time.
as those plugins get cached on disk and further execution
of maven is much faster then the first time.

      org.apache.httpcomponents:httpclient:[4.5.14,4.5.99999]:compile
      org.apache.httpcomponents:httpmime:[4.5.14,4.5.99999]:compile
      commons-logging:commons-logging:[1.2,1.99999]:compile
      commons-codec:commons-codec:[1.11,1.99999]:compile
      org.apache.httpcomponents:httpcore:[4.4.16,4.4.99999]:compile
❯ echo $?
0

jsvd avatar Jan 06 '26 09:01 jsvd