From kirill.ishanov at gmail.com Mon Nov 26 04:31:55 2007 From: kirill.ishanov at gmail.com (Kirill Ishanov) Date: Mon, 26 Nov 2007 12:31:55 +0300 Subject: [Raven-user] Error in converting .m2 repository mechanism Message-ID: <50fa8a6a0711260131q7672547ev1b9b71c57088f62b@mail.gmail.com> Hi there, Today we tried to convert existing maven 2 repository and caught the following error: /home/kylichuku/lib/jruby-1.0.2/lib/ruby/gems/1.8/gems/raven-1.2.3/lib/raven/repo_builder.rb:195:in `each': undefined method `[]' for nil:NilClass (NoMethodError) from /home/kylichuku/lib/jruby-1.0.2/lib/ruby/gems/1.8/gems/raven- 1.2.3/lib/raven/repo_builder.rb:258:in `dir_each' from /home/kylichuku/lib/jruby-1.0.2/lib/ruby/gems/1.8/gems/raven- 1.2.3/lib/raven/repo_builder.rb:189:in `foreach' from /home/kylichuku/lib/jruby-1.0.2/lib/ruby/gems/1.8/gems/raven- 1.2.3/lib/raven/repo_builder.rb:285:in `dir_each' from /home/kylichuku/lib/jruby-1.0.2/lib/ruby/gems/1.8/gems/raven- 1.2.3/lib/raven/repo_builder.rb:189:in `each' from /home/kylichuku/lib/jruby-1.0.2/lib/ruby/gems/1.8/gems/raven- 1.2.3/lib/raven/repo_builder.rb:258:in `run' from /home/kylichuku/lib/jruby-1.0.2/lib/ruby/gems/1.8/gems/raven- 1.2.3/lib/raven.rb:51:in `run' from /home/kylichuku/lib/jruby-1.0.2/lib/ruby/gems/1.8/gems/raven- 1.2.3/bin/raven:5 from :1:in `load' After adding verbose output to repo_builder (just printing c_path), and found that it fails on paths like this: /ch/ethz/ganymed/ganymed-ssh2/build210/ganymed-ssh2-build210.jar Looks like the following regular expression doesn't match 'build210' version number (cause it contains letters), so we've replaced groupNArt = c_path[/^.*\/[0-9]/][1..-3] with groupNArt = c_path[/^.*\/(?=.*\/.*)/][1..-2] it searches for the path with positive lookahead and can process such paths. It was a quick and dirty hack, so I'm pretty sure that there is more beautiful way to do this. Regards, Kirill. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raven-user/attachments/20071126/2f76a2ce/attachment.html