Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: b56aa84d2d
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (31 sloc) 1.548 kB
* make sure you use maven3: maven.apache.org/download.html
freshly generated rails application
-----------------------------------
* start the webrick server:
$ mvn rails2:server
* point your browser for further info to: http://localhost:3000/maven.html
manage the gem dependencies with maven
--------------------------------------
* add all gems in the pom.xml
* remove the version from the config.gem elements in config/environment.rb to avoid conflicts, maven takes care that only one version is present and available for the application
* install all the gems in target/webgems
$ mvn gem:initialize
* if you freeze rails or unpack your dependencies you get some (or all) gems twice inside the war file. so either make sure you remove the respective copy parts from WEB-INF/gems configuration in pom.xml or remove the copy parts on the vendor directory to avoid duplications.
using the application without maven again
-----------------------------------------
just run
$ mvn gem:initialize
and set
$ export GEM_HOME=target/webgems
$ export GEM_PATH=target/webgems
or the other way around, let maven use your system rubygems and set in $HOME/.m2/settings.xml
<profiles>
<profile>
<id>rubygems</id>
<properties>
<jruby.gem.path>/path/to/your/system/gems</jruby.gem.path>
<jruby.gem.home>/path/to/your/system/gems/home</jruby.gem.home>
</properties>
</profile>
</profiles>
with this maven will install gems in the system rubygems (maybe you need to sudo the mvn command to do so).
Jump to Line
Something went wrong with that request. Please try again.