Class: Warbler::JettyServer

Inherits:
WebServer show all
Defined in:
lib/warbler/web_server.rb

Instance Method Summary collapse

Methods inherited from WebServer

#main_class

Constructor Details

#initializeJettyServer

Returns a new instance of JettyServer.


90
91
92
93
94
# File 'lib/warbler/web_server.rb', line 90

def initialize
  @artifact = Artifact.new(ENV["MAVEN_REPO"] || "http://repo2.maven.org/maven2",
                           "org.eclipse.jetty", "jetty-runner",
                           ENV["WEBSERVER_VERSION"] || "9.2.9.v20150224")
end

Instance Method Details

#add(jar) ⇒ Object


96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/warbler/web_server.rb', line 96

def add(jar)
  super
  jar.files["WEB-INF/webserver.xml"] ||= StringIO.new(<<-CONFIG)
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">
</Configure>
CONFIG

  jar.files["WEB-INF/webserver.properties"] = StringIO.new(<<-PROPS)
mainclass = org.eclipse.jetty.runner.Runner
args = args0,args1,args2,args3,args4,args5,args6
props = jetty.home
args0 = --host
args1 = {{host}}
args2 = --port
args3 = {{port}}
args4 = --config
args5 = {{config}}
args6 = {{warfile}}
jetty.home = {{webroot}}
PROPS
end