lib/buildr/jetty.rb in buildr-1.2.6 vs lib/buildr/jetty.rb in buildr-1.2.7
- old
+ new
@@ -34,11 +34,11 @@
# 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}", "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") }
+ Java.wrapper.setup { |jw| jw.classpath << REQUIRES << File.join(__DIR__, "jetty") }
# Default URL for Jetty (change with options.jetty.url).
URL = "http://localhost:8080"
class << self
@@ -72,16 +72,14 @@
# Starts Jetty. This method does not return, it keeps the thread running until
# 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")
+ Java.wrapper do |jw|
+ puts "classpath #{jw.classpath.inspect}"
port = URI.parse(url).port
puts "Starting Jetty at http://localhost:#{port}" if verbose
- jetty = Rjb::import("JettyWrapper").new(port)
+ jetty = jw.import("JettyWrapper").new(port)
sync << "Started" if sync
sleep # Forever
end
rescue Interrupt # Stopped from console
rescue Exception=>error