lib/buildr/jetty.rb in buildr-1.2.5 vs lib/buildr/jetty.rb in buildr-1.2.6

- old
+ new

@@ -27,16 +27,19 @@ # which are called when Jetty is first used in the build, and when the build ends. class Jetty # Which version of Jetty we're using by default (change with options.jetty.version). VERSION = "6.1.3" - + SLF4J_VERSION = "1.4.3" + # Libraries used by Jetty. REQUIRES = [ "org.mortbay.jetty:jetty:jar:#{VERSION}", "org.mortbay.jetty:jetty-util:jar:#{VERSION}", - "org.mortbay.jetty:servlet-api-2.5:jar:#{VERSION}", "log4j:log4j:jar:1.2.13", "commons-logging:commons-logging:jar:1.1" ] + "org.mortbay.jetty:servlet-api-2.5:jar:#{VERSION}", "org.slf4j:slf4j-api:jar:#{SLF4J_VERSION}", + "org.slf4j:slf4j-simple:jar:#{SLF4J_VERSION}", "org.slf4j:jcl104-over-slf4j:jar:#{SLF4J_VERSION}" ] + Java.rjb.onload { |rjb| rjb.classpath << REQUIRES << File.join(__DIR__, "jetty") } - + # Default URL for Jetty (change with options.jetty.url). URL = "http://localhost:8080" class << self @@ -70,9 +73,12 @@ # Jetty is stopped. If you want to run Jetty parallel with other tasks in the build, # invoke the #use task instead. def start(sync = nil) begin Java.rjb do + puts "RJB classpath #{Java.rjb.classpath.inspect}" + props = Rjb::import('java.lang.System').getProperties + props.setProperty("log4j.configuration", "file:./log4j.properties") port = URI.parse(url).port puts "Starting Jetty at http://localhost:#{port}" if verbose jetty = Rjb::import("JettyWrapper").new(port) sync << "Started" if sync sleep # Forever