Welcome aboard
You’re riding Ruby on Rails with Maven!
Getting started
Here’s how to get rolling:
-
Use
mvn rails${railsVersion.substring(0,1)}:generate
to create your models and controllersTo see all available options, run it without parameters.
example:
mvn rails${railsVersion.substring(0,1)}:generate -Dargs="scaffold user name:string"
-
Set up a default route and remove or rename this file
Routes are set up in
config/routes.rb
. -
Create your database
Run
mvn rails${railsVersion.substring(0,1)}:rake -Dargs="db:create db:migrate"
to create your database. If you're not using SQLite (the default), editconfig/database.yml
with your username and password.mvn rails${railsVersion.substring(0,1)}:rake -Dargs="db:create db:migrate RAILS_ENV=production"
-
Start embedded servlet-engine
Run
mvn jetty:run-war
after creating a production database. -
Package your war file
mvn package
will produce a war file intarget
. -
More help for maven goals
mvn rails${railsVersion.substring(0,1)}:help
for rails specific goals.mvn gem:help
for rubygems specific goals.mvn ruby:help
for jruby specific goals.