So, I followed the instructions in Build.md to generate the jbundler.war file, which was painfully slow, by the way.
After that, I still had another issue. I set JRUBY_OPTS=--1.9 in my .bashrc, so I had to fix part of the code for 1.9 compatibility:
mavenfile.rb: File.read(@file).each do |line| became File.read(@file).each_line do |line| After that I guess info.rb worked as expected, producing: 8 [ScriptThreadProcess: info.rb] INFO hello - classpath: /home/rodrigo/.m2/repository/org/slf4j/slf4j-simple/1.6.4/slf4j-simple-1.6.4.jar /home/rodrigo/.m2/repository/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar /home/rodrigo/.m2/repository/msv/isorelax/20050913/isorelax-20050913.jar /home/rodrigo/.m2/repository/thaiopensource/jing/20030619/jing-20030619.jar /home/rodrigo/.m2/repository/nekohtml/nekodtd/0.1.11/nekodtd-0.1.11.jar /home/rodrigo/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar /home/rodrigo/.m2/repository/net/sourceforge/nekohtml/nekohtml/1.9.15/nekohtml-1.9.15.jar /home/rodrigo/.m2/repository/xerces/xercesImpl/2.9.0/xercesImpl-2.9.0.jar Mvnfile.lock was also generated: remote: http://repo1.maven.org/maven2/ artifacts: org.slf4j:slf4j-simple:jar:1.6.4 org.slf4j:slf4j-api:jar:1.6.4 ruby.bundler:gem_with_jar:pom:0.0.0 ruby.bundler:nokogiri-maven:pom:1.5.0 msv:isorelax:jar:20050913 thaiopensource:jing:jar:20030619 nekohtml:nekodtd:jar:0.1.11 xml-apis:xml-apis:jar:1.0.b2 net.sourceforge.nekohtml:nekohtml:jar:1.9.15 xerces:xercesImpl:jar:2.9.0 .jbundler/classpath.rb: JBUNDLER_CLASSPATH = []JBUNDLER_CLASSPATH << '/home/rodrigo/.m2/repository/org/slf4j/slf4j-simple/1.6.4/slf4j-simple-1.6.4.jar' JBUNDLER_CLASSPATH << '/home/rodrigo/.m2/repository/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar' JBUNDLER_CLASSPATH << '/home/rodrigo/.m2/repository/msv/isorelax/20050913/isorelax-20050913.jar' JBUNDLER_CLASSPATH << '/home/rodrigo/.m2/repository/thaiopensource/jing/20030619/jing-20030619.jar' JBUNDLER_CLASSPATH << '/home/rodrigo/.m2/repository/nekohtml/nekodtd/0.1.11/nekodtd-0.1.11.jar' JBUNDLER_CLASSPATH << '/home/rodrigo/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar' JBUNDLER_CLASSPATH << '/home/rodrigo/.m2/repository/net/sourceforge/nekohtml/nekohtml/1.9.15/nekohtml-1.9.15.jar' JBUNDLER_CLASSPATH << '/home/rodrigo/.m2/repository/xerces/xercesImpl/2.9.0/xercesImpl-2.9.0.jar'
JBUNDLER_CLASSPATH.freeze JBUNDLER_CLASSPATH.each { |c| require c }So, it sounds good so far. I'd have to make some experiments with it in some real-world project to get a better feeling about this, but it seems to be promising.
Congratulations, pal :) Have a great weekend, Rodrigo. Em 06-04-2012 23:20, Rodrigo Rosenfeld Rosas escreveu:
Hi Kristian, I'm just back to home. It didn't create any Mvnfile.lock nor a .jbundler directory here. Am I missing something?Sorry, but I couldn't find time to take a look at the sources yet. I was just trying to test it out-of-the-box.Good night, Rodrigo. Em 06-04-2012 13:33, kristian escreveu:hi again Rodrigo, I guess my fixed typo was not the problem. how does you .jbundler/classpath.rb file look like ? -Kristian On Fri, Apr 6, 2012 at 9:20 PM, kristian<m.krist...@web.de> wrote:hi Rodrigo, also happy easter ! well, from the error is looks like the classpath from .jbundler/classpath.rb is empty. but actually I am surprised that you did not see another error since there was a little typo in the code - time to get specs ready ! please remove the Mvnfile.lock if it is there to trigger the generation of a new classpath.rb file. regards, Kristian On Fri, Apr 6, 2012 at 8:25 PM, Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com> wrote:Hi Kristian, I followed the instructions in the README, but adapted to useRVM: rvm jruby cd example/my_project bundle install bundle exec info.rb And it raised this exception: NameError: cannot load Java class org.slf4j.LoggerFactory get_proxy_or_package_under_package at org/jruby/javasupport/JavaUtilities.java:54 method_missing at/home/rodrigo/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51(root) at info.rb:3 Am I missing something? Happy Easter! Rodrigo. Em 05-04-2012 18:10, kristian escreveu:hi Charlie, did you speak about the jbundler idea ? from Rondrigo's response I concluded this.currently it does not depend on "changing" bundler, rubygems or jruby. there is NO technical dependency to the jruby-1.7 release. so any edgecase can be dealt and fixed when it pops up. since there is some interest on the project. today someone help me to fix "finding the right maven" and he is trying it out on one or twoproduction projects. once I get positive feedback it is time to push a "prerelease" gem. maybe Rodrigo finds some time to look at it too - atleast the problems he reported are fixed now. GSoC - I have the feeling the remaining parts might be (if wanted) some command line tools which is pure ruby code without any direct connection to jruby. conceptually jbundler is nothing new and very similar what ruby-maven does - instead of using maven to resolve the gems version, jbundler uses **bundler** :) if I compare it to the maven-gem/gemify approach where I do know lotsof dead ends which will never work then with jbundler there is none sofar. for me it already works better then maven_gemify and I will be happy if I can dump that gemify code for good. I personally have a week to put specs into jbundler then I am offline until May. propagating jbundler instead of maven_gemify would help to mature things faster - and maven_gemify still is labeled "experimental" :) jbundler is just some clue code between bundler and aether(maven) and adding a lock file to the whole thing. enough said - I guess I am just amazed how little code was needed to get it running. regards, Kristian On Thu, Apr 5, 2012 at 9:05 PM, Charles Oliver Nutter <head...@headius.com> wrote:Ok, time for a status update. GSoC proposals close tomorrow. Given the timeframe of May for a JRuby 1.7 preview release, does it seem like we can have this work done or is this something that might take more than a month? I emphasize this is a preview release; JRuby 1.7 has had such a long cycle and major changes we're not goingstraight into RC cycle like we did with 1.6. There will probably be a good month of cooling down after the preview release (around May 22),and then we'll look at an RC cycle starting in June.Where do we stand, what needs to be done, will we have time for / wanta GSoC project? - CharlieOn Wed, Apr 4, 2012 at 1:32 PM, kristian<m.krist...@web.de> wrote:thanx anyways. your input so far was really great made the whole thing happen. and it feels like a clean solution. hope you find some time to see what is going on with your maven3/ruby-maven error since that partis copy and paste of the current maven_gemify.rb from jruby. thanx again. Kristian On Wed, Apr 4, 2012 at 11:41 PM, Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com> wrote:Hi Kristian, I tried once to give it a quick try, but it complainedabout Maven3 not being installed.I have it installed and I even installed the ruby-maven gem but theerror persisted.I didn't have time for fixing it because I need to fix some issues withthe Grails application I maintain and just reported a(nother) bug in Grails: http://jira.grails.org/browse/GRAILS-8994I'm in a hurry with some issues this week and that is why I'm not abletoinvest much time on this Maven-Bundler integration until I can breathea bit. But good to know that this is advancing somehow. Best, Rodrigo. Em 04-04-2012 13:39, kristian escreveu: Hi Rodrigo, I just rounded up the whole thing - hope it works for someonedifferent then me. there are no commandline tools, no groups in the Mvnfile and version resolution is split between gems (done by bundler)and jars (done by jbundler).the only thing which is missing from my side are specs and maybe but some common code between jbundler, ruby-maven and jruby-maven-pluginsinto a common gem. any feedback is welcome. regards, Kristian On Mon, Apr 2, 2012 at 6:31 AM, Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com> wrote:Hi Kristian, I'm just back home after a long weekend. I'll try to findsome time this week to take a look at this project. Thank you for your effort on this. Cheers, Rodrigo. Em 01-04-2012 17:42, kristian escreveu: Hi Rodrigo, I just put a few ideas and pieces together in https://github.com/mkristian/jbundlera Mvnfile.lock needs to step deeper into maven but once the embedding of maven or using of aether is clear, the actual Mvnfile.lock is quiteeasy to achieve. regards, Kristian On Fri, Mar 30, 2012 at 7:08 PM, Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com> wrote: I'd love to see this completed until 1.7 release date, about May. But honestly, this requires a lot of energy for discussing some approachwith the Bundler team that would work for all of us in a sustainableway. Personally, I think it would be better to separate the Maven integrationconcerns from the Bundler repository itself. We should define an API sothatwe can keep working on the Maven integration as a separate gem thatwould be used by Bundler through an API (I'm thinking in some hook here).So, it is not just about implementing some solution that works, butaboutdiscussing the proper way to achieve it so that the JRuby community canmakeprogress on the Maven integration to Bundler in a fast pace instead of depending on pull requests to be approved by the Bundler team which isnaturally more interested in Ruby related issues than on Java integration ones.This can require a lot of time and having someone allocated by the GSocwould help this getting traction.Personally, in the meanwhile I'm using this solution right now whilemaking some experiments with a JRuby on Rails project. I've created some files in the root of my project: Mvnfile --- #org.apache.solr:solr-solrj:3.5.0 org.apache.poi:poi:3.7 --- pom.xml.template --- <project> <modelVersion>4.0.0</modelVersion> <groupId>ignore</groupId> <artifactId>ignore</artifactId> <version>1</version> <dependencies> <%= dependencies %> </dependencies> </project> --- resolve-maven-dependencies.sh --- #!/bin/bash source $HOME/.rvm/scripts/rvm source .rvmrc # optionally we can run bundle too from here # bundle rvm 1.9.3 ruby generate-pom.rb rm -rf lib/mvn mvn -DoutputDirectory=lib/mvn/ dependency:copy-dependencies --- .rvmrc --- rvm jruby@my_application --create --- generate-pom.rb --- require 'erb' dependencies = '' File.read('Mvnfile').each_line do |dep| dep = dep.chomp.strip next if dep.empty? || dep.start_with?('#') group, artifactId, version = dep.split ':' dependencies += " <dependency> <groupId>#{group}</groupId> <artifactId>#{artifactId}</artifactId> <version>#{version}</version> </dependency> " end File.write 'pom.xml', ERB.new(File.read('pom.xml.template')).result(binding) --- config/initializers/0-add-maven-dependencies-to-classpath.rb --- if RUBY_PLATFORM == 'java'require 'java' # not actually needed, but better to be explicit aboutit Dir["#{Rails.root}/lib/mvn/*.jar"].each{|f| require f} end ---This is working for me and I don't have any problems with this setup.Myonly concern is that someone deciding between JRuby on Rails and Grailswill find their integration to Maven much simpler. Best, Rodrigo. Em 30-03-2012 09:31, Charles Oliver Nutter escreveu: My primary concern is that we had really hoped to have themaven/rubygems/bundler support *finalized* for JRuby 1.7, which willpreview in May for JRubyConf. The final release schedule isn't decided, but it will certainly be long before the end of summer... Is that unreasonable? We're talking about preview in a bit over a month and a half.We also want time for people to test the capability. Is this too big athing to "add" or "fix" in a 1.7.x release? I have no objection to this being a GSoC project in general...it's just timeframes that concern me. - Charlie On Fri, Mar 30, 2012 at 5:35 AM, kristian<m.krist...@web.de> wrote: so I just put it briefly: there is a demand to get bundler with maven artifact integration.I am happy to help supervising such a project (with the help and inputof other on certain issue of course) so for me the question is how does could this materialize ? I could register myself as GSoC mentor and then what ? regards, Kristian On Fri, Mar 30, 2012 at 1:46 AM, Charles Oliver Nutter <head...@headius.com> wrote: Sorry I have been absent...out of town halfway around the world... I'm here to answer any questions about GSoC, for which student proposals end NEXT WEEK... So fire away with any remaining questions and we'll try to get all answered! - Charlie
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email