On Mon, Feb 1, 2010 at 9:10 PM, Charles Oliver Nutter <head...@headius.com> wrote: > On Thu, Jan 21, 2010 at 10:11 PM, kristian <m.krist...@web.de> wrote: >> hello, >> >> started to write a maven gem plugin a while ago and started to use it >> in two of my projects. > > I totally missed this, but it sounds awesome! I have been talking with > Sonatype guys about how best to make Maven depend on and install gems, > and it seems like you're well on your way. Can we talk more about > this? What's the current status (anything changed since your original > email a couple weeks ago)? >
the current status is, that you can declare gem artifacts in your pom and maven installs them for you into the local repository as well the plugin installs the gem artifact in that gem repository. for the jruby plugins (jruby-maven-plugin, gem-maven-plugin, rails-maven-plugin) you can define (for the forked mode) GEM_HOME, GEM_PATH and setting this to target/rubygems will give you a gem repository inside your project. after a clean it has no duplicated gems and standard rubygems works without the common "cant' activate . . . " errors. I feel it is a one of the good features of bundler has. the plugin can * gem artifacts from a normal java projects and package them as gem and install into the local maven repository * gem artifacts from a normal ruby projects via a gemspec and package them as gem and install into the local maven repository there are two big things missing: * take the complete dependencies tree of gem artifacts in account, right now things work only with artifacts given in the pom directly * create the pom.xml from gemspec of the gem when maven downloads a copy of the gem into local repository - right now it is just a pom-stub with groupId, artifactId and version in place. a more minor things is the metadata.xml the list of versions available for a given pom. you can extract the info from an html page of gemcutter though some restful API would be nice. xml (does not need to be the maven xml grammar) would be nicer then scrapping data of an html page (which is meant for humans and not machines and the format might change any time). if the gemspec to pom converter is ready the rest should fall in place more or less. one idea to create a gem artifact is to use maven command line inside an normal ruby project: mvn gem:install -Dgemspec=.... which installs the gem artifact in the local repository. or put a pom.xml inside that project and handle your ruby tasks with maven as much possible. or start with a pom.xml for a ruby-only project or a jruby project with includes a java library. i.e. make it possible to have mixed java and ruby multi modules projects - some are ruby only, some are java only and some are even mixed java/ruby and you can manage everything through maven. even generating a gem out of java artifact is still something worth having via a maven plugin I guess. I will look at one time to reuse the code from the sonatype guys unless have such functionality for a maven plugin already. but right now I am more focused on the maven side of things and once I can manage everything from via a pom.xml for rails projects I will be content. I thought I am close until I found out the bundler and the gem-maven-plugin are doing similar things in respect of ensuring that the dependency graph does load properly. maybe it is not worth the effort, but what I like about maven is that you can start the server or build the war file and no need of doing something else to set up things - just download the sources and mvn jetty:run-war starts the the rails application as a war file including the download of the needed gems. a few people started using my plugins - whether for compiling ruby code into java classes or calling ruby which produces some output for further processing. so soon I will to think about what to do with the plugin - the main thing here is the use of my personal repostiory: * either ask maven to scrape my personal repository and include them into the central repository * asked mojo codehaus to include these plugins * asked jruby to give these plugins a new home. but I guess first I focus on my little self induced goals. with regards Kristian > Perhaps you might also be willing to collaborate on the "polyglot > maven" project? I believe that seamless two-way integration of Maven > and RubyGems would be a great help to JRuby adoption going forward. > > Very exciting! > >> http://github.com/mkristian/jruby-maven-plugins/ >> >> it introduce a gem maven artifact, i.e. you can manage your gems with maven. >> >> with maven3 you can declare gemcuttter to be a maven repository (with >> a custom layout) and maven downloads the gems from there and installs >> them in the local repository (this is not possible with maven2 as far >> I know). the generated pom is minimal without any dependencies - it is >> possible to parse the gemspec and create a much better pom (coming >> soon). >> >> after installing the gem in local repository, the maven plugin takes >> all the gems (declared as dependencies) and installs them the ruby way >> (i.e. jgem install -l xyz.gem). >> >> to have clean environment you can set to system properties: >> jruby.gem.home and jruby.gem.path to target/rubygems and have a per >> project rubygems repository. >> >> there are some more goals to the plugin, like package a gem from >> gemspec or from a pom. gem from a pom can be a ruby only gem or one >> with a java extension which uses maven packaging 'java-gem'. >> >> some more ideas you get through the integration tests (maven3 + >> maven2) - see the flags.txt for the commandline arguments, goals.txt >> for goals executed with the test. >> >> jruby-maven-plugins/gem-maven-plugin/src/it >> >> and for maven3 only there is modular setup (needs some tests to see >> whether things are done right or not): >> >> $ cd jruby-maven-plugins/gem-maven-plugin/play >> $ mvn3 clean install >> >> example of a project with a java-gem: >> http://github.com/mkristian/dm-lucene-adapter >> >> example of rails project with gem artifacts: >> http://github.com/mkristian/sahyadri >> >> so please comment on these ideas. >> >> with regards >> Kristian >> with regards >> Kristian >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > -- Kristian Meier + Saumya Sharma + Sanuka Meier Vadakkethu House, Edayanmula West PO - 689532, Pathanamthitta District, Kerala, INDIA tel: +91 468 2319577 protect your privacy while searching the net: www.ixquick.com _=_ q(-_-)p '_) (_` /__/ \ _(<_ / )_ (__\_\_|_/__) --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email