Jruby + rails3 via maven3

hello,

I just setup a release of the jruby-maven-plugins including a plugin
to start a rails3 application

you need maven 3 and java 1.6 !!! sorry for the demand on latest
software . . . :
http://maven.apache.org/download.html

but you do NOT need a jruby installation, a ruby installation or
rubygems, JUST maven3 and java

now you need to download a pom.xml file to get started. the pom.xml
becomes obsolete once the plugin is part of the maven central
repository. but currently is also serves to download a snapshot of the
activerecord-jdbc-adapter.gem from my personal repository.

$ wget
http://github.com/mkristian/jruby-maven-plugins/raw/master/rails3-maven-plugin/demo/pom.xml

to generate the rails application execute
$ mvn rails3:rails -Dapp_path=myapp

go into the application directory
$ cd myapp

scaffold a resource
$ mvn rails3:generate -Dgenerator=scaffold -Dargs=“account name:string”

migrate the database
$ mvn rails3:rake -Dtask=db:migrate

start the server
$ mvn rails3:server

to get away from maven, pack all gems in vendor
$ mvn ruby:jruby -Djruby.args=“target/rubygems/bin/bundle pack”

from that point you know better how to proceed . . .

see also
http://github.com/mkristian/jruby-maven-plugins/tree/master/rails3-maven-plugin/demo/

please tell me if this worked for you and if not what did not work for
you. I have great doubts that it will work on windows since the path
handling might not platform independent here and there. but on unix
like OS it should work. I also tested the procedure a few times also
with empty local repository but most of the code is brand new - so
excuse me if things are not so smooth for you. BUT please help to get
this a smooth experience by reporting issues (or patches) or even by
constructive criticism about maven :wink:

I will be offline (on houseboat in kerala) the next two days but I
will take care of any issues reported to me when I am online again.

the next little thing will be another maven goal to pack the
application as war file:
$ mvn install

or start a servlet engine from maven
$ mvn jetty:run-exploded
with regards
Kristian


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email