From 6361b018d74c83ed9993399c7886831c85273506 Mon Sep 17 00:00:00 2001 From: Kristian Meier Date: Sun, 17 Jun 2012 13:41:49 +0530 Subject: [PATCH] cleanup code and leave maven options for the time being [ci skip] --- README.md | 36 +++++++++++++++++++++++++++++++----- bin/jetty-run | 43 ++++++------------------------------------- 2 files changed, 37 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 89df840..6e08501 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,42 @@ # jetty run [![Build Status](https://secure.travis-ci.org/mkristian/jetty-run.png)](http://travis-ci.org/mkristian/jetty-run) # -# -jetty-run will use Gemfile/Gemfile.lock and Jarfile/Jarfile.lock to setup an environment to start rails in development mode with jetty. it uses ruby-maven to achieve this, i.e. all missing jar dependencies (jetty and all) will be downloaded on the first run (that can take time since it is a lot). +## install ## + +first uninstall older ruby-maven (< 3.0.4.0.29.0) if present, they will otherwise conflict with jetty-run command + + $ gem uninstall ruby-maven + $ gem install jetty-run + +## usage ## + + $ cd my_rails_app + $ jruby -S bundle install + $ jetty-run + +for `bundle install` you need to use JRuby since Gemfile.lock needs to be for the java platform. `jetty-run` works with both MRS and JRUBY - MRI starts up slightly faster. + +jetty-run will use Gemfile/Gemfile.lock and Jarfile/Jarfile.lock to setup an environment to start rails in development mode with jetty. it uses ruby-maven to achieve this, i.e. all missing jar dependencies (jetty and all) will be downloaded on the first run (that can take time since it first needs to download all the jetty related jars). jetty will start with port 8080 (none ssl) and 8443 (ssl). the ssl certificate is ./src/test/resources/server.keystore with password '123456' - it will be copied there on the first run. -to customize jetty you can use _Mavenfile_ which allows to reconfigure jetty-maven-plugin with a ruby DSL: +to customize jetty you can use the _Mavenfile_ which allows to reconfigure jetty-maven-plugin: - properties['jetty.version'] = '7.5.1.v20110908' + properties['jetty.version'] = '7.5.1.v20110908' TODO more advanced example and current config +## running any given war-file ## + + jetty-war war /path/to/war-file + +with this you warble your warfile and use jetty-run to start it with jetty. + +## more ## + +see + + jetty-run help + # note # -most functionality is hidden inside 'maven-tools' gem and de.saumya.mojo:ruby-tools jar (from jruby-maven-plugins). it was first part of these jruby-maven-plugins and slowly the functionality moved to the ruby side of things. so things are on the move . . . +orginally the code was part the jruby-maven-plugins and slowly the functionality moved to the ruby side of things. so things are on the move and there is room for improvements . . . diff --git a/bin/jetty-run b/bin/jetty-run index cb8fc65..680eb25 100755 --- a/bin/jetty-run +++ b/bin/jetty-run @@ -1,36 +1,4 @@ #!/usr/bin/env ruby -# if ARGV.size > 4 || ARGV[0] == "--help" || ARGV[0] == "-h" || ARGV[0] == "-?" -# puts "usage: #{File.basename($0)} [-e ] [--war []]" -# puts "\tdefault environment: development" -# exit 1 -# end - -# args = [__FILE__.gsub(/-/, ':').gsub(/.*[\/\\]/, '')] -# if ARGV.size == 2 && ARGV[0] == "-e" -# args << "-Drails.env=#{ARGV[1]}" -# args << "-Prun" -# elsif ARGV.size == 1 && ARGV[0] == "--war" -# args = ["jetty:run-war", "-Pwar"] -# elsif ARGV.size == 2 && ARGV[0] == "--war" -# args = ["jetty:deploy-war", "-DwebApp=#{ARGV[1]}", "-Pwar"] -# elsif ARGV.size == 3 && ARGV[0] == "-e" && ARGV[2] == "--war" -# args = ["jetty:run-war", "-Pwar", "-Drails.env=#{ARGV[1]}"] -# elsif ARGV.size == 3 && ARGV[1] == "-e" && ARGV[0] == "--war" -# args = ["jetty:run-war", "-Pwar", "-Drails.env=#{ARGV[2]}"] -# elsif ARGV.size == 4 && ARGV[0] == "-e" && ARGV[2] == "--war" -# args = ["jetty:deploy-war", "-Pwar", "-DwebApp=#{ARGV[3]}", "-Drails.env=#{ARGV[1]}"] -# elsif ARGV.size == 4 && ARGV[2] == "-e" && ARGV[0] == "--war" -# args = ["jetty:deploy-war", "-Pwar", "-DwebApp=#{ARGV[1]}", "-Drails.env=#{ARGV[3]}"] -# end -# ARGV.replace(args) -# if !File.exists?(File.join('config', 'web.xml')) && !File.exists?(File.join('src', 'main', 'webapp', 'WEB-INF', 'web.xml')) -# require 'fileutils' -# web_xml = Gem.find_files( 'maven/jetty/web.xml').first -# FileUtils.cp(web_xml, 'config') -# end -# load Gem.bin_path('ruby-maven', 'rmvn') - - require 'maven/jetty/ruby_maven' require 'thor' @@ -97,11 +65,12 @@ class JettyCommand < Thor when 'war' 'deploy-war' end - if goal - puts - puts "Maven Options: (from jetty maven plugin)" - exec ["jetty:help", "-Ddetail=true", "-Dgoal=#{goal}"] - end +# TODO not sure whether or not these options are needed/helpful +# if goal +# puts +# puts "Maven Options: (from jetty maven plugin)" +# exec ["jetty:help", "-Ddetail=true", "-Dgoal=#{goal}"] +# end end end