After testing with different path formats (single-quoted, double-quoted, with forward slashes and backslashes), I noticed that File.expand_path always expands the path to "F:/project/pom.xml".
It seems the error has something to do with my local maven configuration (M2_REPO, etc), based on the stacktrace. After setting the M2_REPO environment variable, the stacktrace changed, but not the final exception. I will investigate further and post results later. Thanks for the help so far! On Thu, Mar 8, 2012 at 3:12 PM, Antoine Toulme <[email protected]> wrote: > I think the path you pass along is invalid. > > The path in Windows is expected to use backticks, F:\project\pom.xml. > > jruby, trying to read this path, fails in the expand_path method. > > That's all I can tell at first sight (and without a Windows machine). > > You can try to read the JRuby source code for that method to find out more. > https://github.com/jruby/jruby/blob/1.6.5.1/src/org/jruby/RubyFile.java#L1100 > > On Thu, Mar 8, 2012 at 09:36, Khristian <[email protected]> wrote: > >> I'm trying to read an existing Maven 2 POM file in an application I'm >> developing. For this, I tried to use Buildr in the following ways: >> >> ---------------------- >> require 'rubygems' >> require 'buildr' >> >> path="F:/project/pom.xml" >> >> # POM.load: >> pom=Buildr::POM.load(path) >> >> # Generate: >> Buildr::Generate::from_maven2_pom(path) >> ----------------------- >> Both ways fail in the same way (from pom.rb:52): >> >jruby pom.rb >> TypeError: can't convert nil into String >> expand_path at org/jruby/RubyFile.java:1100 >> buildfile at >> >> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/core/application.rb:171 >> load_from at >> >> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/core/application.rb:108 >> user at >> >> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/core/application.rb:76 >> local at >> >> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:594 >> locate at >> >> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:622 >> artifact at >> >> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/packaging/artifact.rb:758 >> load at >> >> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/java/pom.rb:39 >> initialize at >> >> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/java/pom.rb:74 >> load at >> >> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/java/pom.rb:52 >> from_maven2_pom at >> >> c:/prog/jruby-1.6.5.1/lib/ruby/gems/1.8/gems/buildr-1.4.6-java/lib/buildr/core/generate.rb:95 >> (root) at pom.rb:7 >> >> I am using Buildr 1.4.6 (JRuby 1.6.5.1). >> >> Any idea what might be happening/being done wrong? >> >> Thanks, >> -- >> Khristian Alexander Schönrock >> -- Khristian Alexander Schönrock http://derkosak.blogspot.com - Meu blógue!
