warbler 1.4.5 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f191c5553256cc2b14be10dbb9e5bb4582080046
4
- data.tar.gz: 30b9d9cbb24297872f2bc0f5ec6978f4e2bfa99d
3
+ metadata.gz: 218126abf1ff5e8886c7d9d83efe2a59e2be9dd2
4
+ data.tar.gz: 2e21c4ae9e9f89c80cbdf49b756954f6c1196f28
5
5
  SHA512:
6
- metadata.gz: 5e445e6ad70bcf3047e44661bfb599a43d23491bf80baae4c36f468cd49660b0dce622a01b4bd98ce7eb4e2ed758b72eac1cb4cd5b0a42a30d33599d91f56b0a
7
- data.tar.gz: 2623d3d975d55216dcf3a8574b126ca91e745b20b870672515a34c4ffcbf46b9b0dd7ba678e215b47aaa2315c73e7c21d1c2b5b8d143c4602ab203e3a29de87b
6
+ metadata.gz: af36e2a2b51ca6992acdb4878fb954d4e28b4d6881a5f22e50b86cba6cd68f748b9f37a63e3b2ae690238687910cd2ae31059671150f65e7e36880002eb22bba
7
+ data.tar.gz: f73c4d6797f23a5e3780c921485b6302057d7673d2e7404efa23f00ba439cbbb504227f45abb441a74e243605405f95e34bfec1a2af81a4108f952203e0d587f
data/.travis.yml CHANGED
@@ -10,7 +10,7 @@ matrix:
10
10
  include:
11
11
  - rvm: jruby-head
12
12
  env: JRUBY_OPTS="--server -Xcext.enabled=false -Xcompile.invokedynamic=false"
13
- - rvm: jruby-1.7.12
13
+ - rvm: jruby-1.7.19
14
14
  env: JRUBY_OPTS="--server -Xcext.enabled=false -Xcompile.invokedynamic=false"
15
15
  - rvm: 1.8.7
16
16
  env: ''
@@ -30,8 +30,8 @@ notifications:
30
30
  on_success: change
31
31
  on_failure: always
32
32
  template:
33
- - "%{repository} (%{branch}:%{commit} by %{author}): %{message} (%{build_url})"
34
- before_install:
33
+ - "%{repository} (%{branch}:%{commit} by %{author}): %{message} (%{build_url})"
34
+ before_install:
35
35
  - sudo apt-get update && sudo apt-get install git
36
36
  - git fetch --unshallow
37
37
  - gem install bundler --pre
data/History.txt CHANGED
@@ -1,5 +1,19 @@
1
+ == Master
2
+
3
+ == 1.4.6
4
+ - #315: Removed custom Jetty launcher in favor of jetty-runner
5
+ - #316: Sprockets manifest name change
6
+ - #313: Update Jetty to 9.2.10
7
+ - #311: Don't clear the environment if a java executable is found
8
+ - #268: Compile's clearing of ENV vars makes it impossible to use custom compile vars
9
+
1
10
  == 1.4.5
2
11
  - #282: Wrong default GEM_HOME in generated META-INF/init.rb
12
+ - #305: warbler.rb: Document jar_extension, autodeploy_dir options
13
+ - #304: enable ENV['RACK_ENV'] to honor command line environment variable
14
+ - #296: Use a topological sort to order traits by requirements.
15
+ - #291: Include most current gem version in README
16
+ - #280: config.webserver = 'jetty' (by default)
3
17
 
4
18
  == 1.4.4
5
19
  - #271: LoadError while excute rake command with runnable .war archive
data/Mavenfile CHANGED
@@ -12,7 +12,7 @@ properties( 'tesla.dump.pom' => 'pom.xml',
12
12
  # dependencies needed for compilation
13
13
  scope :provided do
14
14
  jar 'org.jruby:jruby', '1.7.8'
15
- jar 'org.eclipse.jetty:jetty-webapp', '8.1.9.v20130131'
15
+ jar 'org.eclipse.jetty:jetty-webapp', '9.2.10.v20150310'
16
16
  end
17
17
 
18
18
  plugin :compiler, '3.1', :source => '1.5', :target => '1.5'
data/lib/warbler/jar.rb CHANGED
@@ -62,7 +62,7 @@ module Warbler
62
62
  compiled_ruby_files.each_slice(2500) do |slice|
63
63
  # Need to use the version of JRuby in the application to compile it
64
64
  javac_cmd = %Q{java -classpath #{config.java_libs.join(File::PATH_SEPARATOR)} #{java_version(config)} org.jruby.Main #{compat_version} -S jrubyc \"#{slice.join('" "')}\"}
65
- if which('env')
65
+ if which('java').nil? && which('env')
66
66
  system %Q{env -i #{javac_cmd}}
67
67
  else
68
68
  system javac_cmd
@@ -1,11 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- if RUBY_VERSION =~ /^1.8/
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
7
- else
8
- APP_PATH = File.expand_path('../../config/application', __FILE__)
9
- require_relative '../config/boot'
10
- require 'rails/commands'
11
- end
3
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
4
+ require File.expand_path('../../config/boot', __FILE__)
5
+ require 'rails/commands'
@@ -50,6 +50,7 @@ module Warbler
50
50
  config.webxml.jruby.max.runtimes = 1 unless Integer === config.webxml.jruby.max.runtimes
51
51
  end
52
52
 
53
+ config.includes += FileList["public/assets/.sprockets-manifest-*.json"].existing
53
54
  config.includes += FileList["public/assets/manifest-*.json"].existing
54
55
  config.includes += FileList["public/assets/manifest.yml"].existing
55
56
  end
@@ -27,7 +27,7 @@ module Warbler
27
27
  config.webxml = default_webxml_config
28
28
  config.webinf_files = default_webinf_files
29
29
  config.java_libs = default_jar_files
30
- config.public_html = FileList["public/**/*"]
30
+ config.public_html = FileList["public/**/{.[!.],.??*,*}"] # include dotfiles
31
31
  config.jar_extension = 'war'
32
32
  config.init_contents << "#{config.warbler_templates}/war.erb"
33
33
  end
@@ -6,5 +6,5 @@
6
6
  #++
7
7
 
8
8
  module Warbler
9
- VERSION = "1.4.5"
9
+ VERSION = "1.4.6"
10
10
  end
@@ -116,14 +116,14 @@ PROPS
116
116
  class JettyServer < WebServer
117
117
  def initialize
118
118
  @artifact = Artifact.new(ENV["MAVEN_REPO"] || "http://repo2.maven.org/maven2",
119
- "org.jruby.warbler", "warbler-embedded-jetty",
120
- ENV["WEBSERVER_VERSION"] || "1.0.0")
119
+ "org.eclipse.jetty", "jetty-runner",
120
+ ENV["WEBSERVER_VERSION"] || "9.2.9.v20150224")
121
121
  end
122
122
 
123
123
  def add(jar)
124
124
  super
125
125
  jar.files["WEB-INF/webserver.properties"] = StringIO.new(<<-PROPS)
126
- mainclass = JettyWarMain
126
+ mainclass = org.eclipse.jetty.runner.Runner
127
127
  args = args0
128
128
  props = jetty.home
129
129
  args0 = {{warfile}}
@@ -134,7 +134,7 @@ PROPS
134
134
 
135
135
  WEB_SERVERS = Hash.new { |hash,_| hash['jetty'] }
136
136
  WEB_SERVERS['winstone'] = WinstoneServer.new
137
- WEB_SERVERS['jenkins-ci.winstone'] = JenkinsWinstoneServer.new,
137
+ WEB_SERVERS['jenkins-ci.winstone'] = JenkinsWinstoneServer.new
138
138
  WEB_SERVERS['jetty'] = JettyServer.new
139
139
 
140
140
  end
data/lib/warbler_jar.jar CHANGED
Binary file
data/pom.xml CHANGED
@@ -73,7 +73,7 @@ deployment to a Java environment.</description>
73
73
  <dependency>
74
74
  <groupId>org.eclipse.jetty</groupId>
75
75
  <artifactId>jetty-webapp</artifactId>
76
- <version>8.1.9.v20130131</version>
76
+ <version>9.2.10.v20150310</version>
77
77
  <scope>provided</scope>
78
78
  </dependency>
79
79
  </dependencies>
@@ -184,7 +184,7 @@ describe Warbler::Jar do
184
184
  jar.apply(config)
185
185
  file_list(%r{sample_jar.*\.rb$}).size.should == 2
186
186
  if RUBY_VERSION >= '1.9'
187
- file_list(%r{gems.*\.class$}).size.should == 73
187
+ file_list(%r{gems.*\.class$}).size.should == 80
188
188
  else
189
189
  # 1.8.7 uses an older version of rubyzip and so the number of files compiled changes
190
190
  file_list(%r{gems.*\.class$}).size.should == 32
@@ -801,7 +801,7 @@ describe Warbler::Jar do
801
801
 
802
802
  context "with rails version 4" do
803
803
 
804
- let (:manifest_file) { "public/assets/manifest-1234.json" }
804
+ let (:manifest_file) { "public/assets/.sprockets-manifest-1234.json" }
805
805
 
806
806
  shared_examples_for "asset pipeline" do
807
807
  it "automatically adds asset pipeline manifest file to the included files" do
data/web.xml.erb CHANGED
@@ -1,8 +1,8 @@
1
- <!DOCTYPE web-app PUBLIC
2
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
3
- "http://java.sun.com/dtd/web-app_2_3.dtd">
4
- <web-app>
5
- <!-- <display-name>Uncomment and put name :here: for Tomcat Dashboard</display-name> -->
1
+ <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
2
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
4
+ version="3.1">
5
+ <!-- <display-name>Uncomment and put name :here: for Tomcat Dashboard</display-name> -->
6
6
 
7
7
  <% webxml.context_params.each do |k,v| %>
8
8
  <context-param>
@@ -14,6 +14,7 @@
14
14
  <filter>
15
15
  <filter-name>RackFilter</filter-name>
16
16
  <filter-class>org.jruby.rack.RackFilter</filter-class>
17
+ <async-supported>true</async-supported>
17
18
  </filter>
18
19
  <filter-mapping>
19
20
  <filter-name>RackFilter</filter-name>
metadata CHANGED
@@ -1,145 +1,145 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sieger
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-02 00:00:00.000000000 Z
11
+ date: 2015-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
- version_requirements: !ruby/object:Gem::Requirement
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.9.6
20
- requirement: !ruby/object:Gem::Requirement
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
21
23
  requirements:
22
- - - '>='
24
+ - - ">="
23
25
  - !ruby/object:Gem::Version
24
26
  version: 0.9.6
25
- prerelease: false
26
- type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jruby-jars
29
- version_requirements: !ruby/object:Gem::Requirement
29
+ requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.5.6
34
- - - <
34
+ - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: '2.0'
37
- requirement: !ruby/object:Gem::Requirement
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
38
40
  requirements:
39
- - - '>='
41
+ - - ">="
40
42
  - !ruby/object:Gem::Version
41
43
  version: 1.5.6
42
- - - <
44
+ - - "<"
43
45
  - !ruby/object:Gem::Version
44
46
  version: '2.0'
45
- prerelease: false
46
- type: :runtime
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jruby-rack
49
- version_requirements: !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: 1.1.1
54
- - - <
54
+ - - "<"
55
55
  - !ruby/object:Gem::Version
56
56
  version: '1.3'
57
- requirement: !ruby/object:Gem::Requirement
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
58
60
  requirements:
59
- - - '>='
61
+ - - ">="
60
62
  - !ruby/object:Gem::Version
61
63
  version: 1.1.1
62
- - - <
64
+ - - "<"
63
65
  - !ruby/object:Gem::Version
64
66
  version: '1.3'
65
- prerelease: false
66
- type: :runtime
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: rubyzip
69
- version_requirements: !ruby/object:Gem::Requirement
69
+ requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - '>='
71
+ - - ">="
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0.9'
74
- - - <
74
+ - - "<"
75
75
  - !ruby/object:Gem::Version
76
76
  version: '1.2'
77
- requirement: !ruby/object:Gem::Requirement
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
78
80
  requirements:
79
- - - '>='
81
+ - - ">="
80
82
  - !ruby/object:Gem::Version
81
83
  version: '0.9'
82
- - - <
84
+ - - "<"
83
85
  - !ruby/object:Gem::Version
84
86
  version: '1.2'
85
- prerelease: false
86
- type: :runtime
87
87
  - !ruby/object:Gem::Dependency
88
88
  name: jbundler
89
- version_requirements: !ruby/object:Gem::Requirement
89
+ requirement: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - ~>
91
+ - - "~>"
92
92
  - !ruby/object:Gem::Version
93
93
  version: 0.5.5
94
- requirement: !ruby/object:Gem::Requirement
94
+ type: :development
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
95
97
  requirements:
96
- - - ~>
98
+ - - "~>"
97
99
  - !ruby/object:Gem::Version
98
100
  version: 0.5.5
99
- prerelease: false
100
- type: :development
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: ruby-maven
103
- version_requirements: !ruby/object:Gem::Requirement
103
+ requirement: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - ~>
105
+ - - "~>"
106
106
  - !ruby/object:Gem::Version
107
107
  version: 3.1.1.0
108
- requirement: !ruby/object:Gem::Requirement
108
+ type: :development
109
+ prerelease: false
110
+ version_requirements: !ruby/object:Gem::Requirement
109
111
  requirements:
110
- - - ~>
112
+ - - "~>"
111
113
  - !ruby/object:Gem::Version
112
114
  version: 3.1.1.0
113
- prerelease: false
114
- type: :development
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: rspec
117
- version_requirements: !ruby/object:Gem::Requirement
117
+ requirement: !ruby/object:Gem::Requirement
118
118
  requirements:
119
- - - ~>
119
+ - - "~>"
120
120
  - !ruby/object:Gem::Version
121
121
  version: '2.10'
122
- requirement: !ruby/object:Gem::Requirement
122
+ type: :development
123
+ prerelease: false
124
+ version_requirements: !ruby/object:Gem::Requirement
123
125
  requirements:
124
- - - ~>
126
+ - - "~>"
125
127
  - !ruby/object:Gem::Version
126
128
  version: '2.10'
127
- prerelease: false
128
- type: :development
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: rdoc
131
- version_requirements: !ruby/object:Gem::Requirement
131
+ requirement: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - '>='
133
+ - - ">="
134
134
  - !ruby/object:Gem::Version
135
135
  version: 2.4.2
136
- requirement: !ruby/object:Gem::Requirement
136
+ type: :development
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
137
139
  requirements:
138
- - - '>='
140
+ - - ">="
139
141
  - !ruby/object:Gem::Version
140
142
  version: 2.4.2
141
- prerelease: false
142
- type: :development
143
143
  description: |-
144
144
  Warbler is a gem to make a Java jar or war file out of any Ruby,
145
145
  Rails, or Rack application. Warbler provides a minimal, flexible, Ruby-like way to
@@ -150,8 +150,8 @@ executables:
150
150
  extensions: []
151
151
  extra_rdoc_files: []
152
152
  files:
153
- - .gitignore
154
- - .travis.yml
153
+ - ".gitignore"
154
+ - ".travis.yml"
155
155
  - Gemfile
156
156
  - History.txt
157
157
  - LICENSE.txt
@@ -163,9 +163,6 @@ files:
163
163
  - ext/WarMain.java
164
164
  - ext/WarblerJar.java
165
165
  - ext/WarblerJarService.java
166
- - ext/jetty/pom.xml
167
- - ext/jetty/src/main/java/JettyWarMain.java
168
- - ext/jetty/src/main/resources/webdefault.xml
169
166
  - integration/Rakefile
170
167
  - integration/pom.xml
171
168
  - integration/rails4_test/pom.xml
@@ -373,29 +370,29 @@ homepage: https://github.com/jruby/warbler
373
370
  licenses:
374
371
  - MIT
375
372
  metadata: {}
376
- post_install_message:
373
+ post_install_message:
377
374
  rdoc_options:
378
- - --main
375
+ - "--main"
379
376
  - README.rdoc
380
- - -H
381
- - -f
377
+ - "-H"
378
+ - "-f"
382
379
  - darkfish
383
380
  require_paths:
384
381
  - lib
385
382
  required_ruby_version: !ruby/object:Gem::Requirement
386
383
  requirements:
387
- - - '>='
384
+ - - ">="
388
385
  - !ruby/object:Gem::Version
389
386
  version: '0'
390
387
  required_rubygems_version: !ruby/object:Gem::Requirement
391
388
  requirements:
392
- - - '>='
389
+ - - ">="
393
390
  - !ruby/object:Gem::Version
394
391
  version: '0'
395
392
  requirements: []
396
- rubyforge_project:
397
- rubygems_version: 2.1.9
398
- signing_key:
393
+ rubyforge_project:
394
+ rubygems_version: 2.4.5
395
+ signing_key:
399
396
  specification_version: 4
400
397
  summary: Warbler chirpily constructs .war files of your Rails applications.
401
398
  test_files:
data/ext/jetty/pom.xml DELETED
@@ -1,103 +0,0 @@
1
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2
- <modelVersion>4.0.0</modelVersion>
3
- <groupId>org.jruby.warbler</groupId>
4
- <artifactId>warbler-embedded-jetty</artifactId>
5
- <version>1.0.0</version>
6
- <name>Warbler Embedded Jetty</name>
7
- <description>An all-in-one-jar embedded Jetty server for use with Warbler's "warble executable war".</description>
8
- <url>http://github.com/jruby/warbler/</url>
9
- <properties>
10
- <jetty.version>8.1.2.v20120308</jetty.version>
11
- </properties>
12
-
13
- <distributionManagement>
14
- <repository>
15
- <id>codehaus-jruby-repository</id>
16
- <name>JRuby Central Repository</name>
17
- <url>dav:https://dav.codehaus.org/repository/jruby</url>
18
- </repository>
19
- <snapshotRepository>
20
- <id>codehaus-jruby-snapshot-repository</id>
21
- <name>JRuby Central Development Repository</name>
22
- <url>dav:https://dav.codehaus.org/snapshots.repository/jruby</url>
23
- </snapshotRepository>
24
- </distributionManagement>
25
-
26
- <repositories>
27
- <repository>
28
- <id>codehaus</id>
29
- <name>Codehaus Repository</name>
30
- <releases>
31
- <enabled>true</enabled>
32
- </releases>
33
- <snapshots>
34
- <enabled>false</enabled>
35
- </snapshots>
36
- <url>http://repository.codehaus.org</url>
37
- </repository>
38
- </repositories>
39
-
40
- <developers>
41
- <developer>
42
- <id>nicksieger</id>
43
- <name>Nick Sieger</name>
44
- <email>nicksieger@gmail.com</email>
45
- </developer>
46
- </developers>
47
-
48
- <dependencies>
49
- <dependency>
50
- <groupId>org.eclipse.jetty</groupId>
51
- <artifactId>jetty-webapp</artifactId>
52
- <version>${jetty.version}</version>
53
- </dependency>
54
- <dependency>
55
- <groupId>org.eclipse.jetty</groupId>
56
- <artifactId>jetty-deploy</artifactId>
57
- <version>${jetty.version}</version>
58
- </dependency>
59
- </dependencies>
60
-
61
- <build>
62
- <defaultGoal>install</defaultGoal>
63
- <plugins>
64
- <plugin>
65
- <groupId>org.apache.maven.plugins</groupId>
66
- <artifactId>maven-dependency-plugin</artifactId>
67
- <version>2.1</version>
68
- <executions>
69
- <execution>
70
- <id>unpack</id>
71
- <phase>prepare-package</phase>
72
- <goals>
73
- <goal>unpack-dependencies</goal>
74
- </goals>
75
- <configuration>
76
- <outputDirectory>${project.build.outputDirectory}</outputDirectory>
77
- <excludes>META-INF/MANIFEST.MF,META-INF/ECLIPSEF.*,META-INF/eclipse.*</excludes>
78
- </configuration>
79
- </execution>
80
- </executions>
81
- </plugin>
82
- <plugin>
83
- <groupId>org.apache.maven.plugins</groupId>
84
- <artifactId>maven-jar-plugin</artifactId>
85
- <version>2.3.1</version>
86
- <configuration>
87
- <archive>
88
- <manifest>
89
- <mainClass>JettyWarMain</mainClass>
90
- </manifest>
91
- </archive>
92
- </configuration>
93
- </plugin>
94
- </plugins>
95
- <extensions>
96
- <extension>
97
- <groupId>org.apache.maven.wagon</groupId>
98
- <artifactId>wagon-webdav</artifactId>
99
- <version>1.0-beta-2</version>
100
- </extension>
101
- </extensions>
102
- </build>
103
- </project>
@@ -1,54 +0,0 @@
1
-
2
- import org.eclipse.jetty.server.Connector;
3
- import org.eclipse.jetty.server.Server;
4
- import org.eclipse.jetty.server.nio.SelectChannelConnector;
5
- import org.eclipse.jetty.webapp.WebAppContext;
6
-
7
- import java.io.File;
8
- import java.io.FileOutputStream;
9
- import java.io.InputStream;
10
-
11
- public class JettyWarMain {
12
-
13
- public static void main(String[] args) throws Exception {
14
- if (args.length == 0) {
15
- throw new IllegalArgumentException("missing war file name");
16
- }
17
-
18
- // Ensure we have a "work" directory for the webapp
19
- if (System.getProperty("jetty.home") != null) {
20
- new File(System.getProperty("jetty.home"), "work").mkdirs();
21
- }
22
-
23
- WebAppContext webapp = new WebAppContext();
24
- webapp.setContextPath("/");
25
- webapp.setExtractWAR(true);
26
- webapp.setWar(args[0]);
27
- webapp.setDefaultsDescriptor(webdefaultPath());
28
-
29
- Server server = new Server();
30
- Connector connector = new SelectChannelConnector();
31
- connector.setPort(Integer.getInteger("jetty.port",8080).intValue());
32
- server.setConnectors(new Connector[]{connector});
33
- server.setHandler(webapp);
34
- server.start();
35
- server.join();
36
- }
37
-
38
- private static String webdefaultPath() throws Exception {
39
- String path = System.getProperty("jetty.home", System.getProperty("java.io.tmpdir")) + System.getProperty("file.separator") + "webdefault.xml";
40
- FileOutputStream out = new FileOutputStream(path);
41
- InputStream is = JettyWarMain.class.getResourceAsStream("/webdefault.xml");
42
- try {
43
- byte[] buf = new byte[4096];
44
- int bytesRead = 0;
45
- while ((bytesRead = is.read(buf)) != -1) {
46
- out.write(buf, 0, bytesRead);
47
- }
48
- } finally {
49
- is.close();
50
- out.close();
51
- }
52
- return path;
53
- }
54
- }
@@ -1,335 +0,0 @@
1
- <?xml version="1.0" encoding="ISO-8859-1"?>
2
-
3
- <!-- ===================================================================== -->
4
- <!-- This file contains the default descriptor for web applications. -->
5
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
6
- <!-- The intent of this descriptor is to include jetty specific or common -->
7
- <!-- configuration for all webapps. If a context has a webdefault.xml -->
8
- <!-- descriptor, it is applied before the contexts own web.xml file -->
9
- <!-- -->
10
- <!-- A context may be assigned a default descriptor by: -->
11
- <!-- + Calling WebApplicationContext.setDefaultsDescriptor -->
12
- <!-- + Passed an arg to addWebApplications -->
13
- <!-- -->
14
- <!-- This file is used both as the resource within the jetty.jar (which is -->
15
- <!-- used as the default if no explicit defaults descriptor is set) and it -->
16
- <!-- is copied to the etc directory of the Jetty distro and explicitly -->
17
- <!-- by the jetty.xml file. -->
18
- <!-- -->
19
- <!-- ===================================================================== -->
20
- <web-app
21
- xmlns="http://java.sun.com/xml/ns/javaee"
22
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
24
- metadata-complete="true"
25
- version="2.5"
26
- >
27
-
28
- <description>
29
- Default web.xml file.
30
- This file is applied to a Web application before it's own WEB_INF/web.xml file
31
- </description>
32
-
33
- <!-- ==================================================================== -->
34
- <!-- Context params to control Session Cookies -->
35
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
36
- <!--
37
- UNCOMMENT TO ACTIVATE <context-param> <param-name>org.eclipse.jetty.servlet.SessionDomain</param-name> <param-value>127.0.0.1</param-value> </context-param> <context-param>
38
- <param-name>org.eclipse.jetty.servlet.SessionPath</param-name> <param-value>/</param-value> </context-param> <context-param> <param-name>org.eclipse.jetty.servlet.MaxAge</param-name>
39
- <param-value>-1</param-value> </context-param>
40
- -->
41
-
42
- <!-- ==================================================================== -->
43
- <!-- The default servlet. -->
44
- <!-- This servlet, normally mapped to /, provides the handling for static -->
45
- <!-- content, OPTIONS and TRACE methods for the context. -->
46
- <!-- The following initParameters are supported: -->
47
- <!--
48
- * acceptRanges If true, range requests and responses are
49
- * supported
50
- *
51
- * dirAllowed If true, directory listings are returned if no
52
- * welcome file is found. Else 403 Forbidden.
53
- *
54
- * welcomeServlets If true, attempt to dispatch to welcome files
55
- * that are servlets, but only after no matching static
56
- * resources could be found. If false, then a welcome
57
- * file must exist on disk. If "exact", then exact
58
- * servlet matches are supported without an existing file.
59
- * Default is true.
60
- *
61
- * This must be false if you want directory listings,
62
- * but have index.jsp in your welcome file list.
63
- *
64
- * redirectWelcome If true, welcome files are redirected rather than
65
- * forwarded to.
66
- *
67
- * gzip If set to true, then static content will be served as
68
- * gzip content encoded if a matching resource is
69
- * found ending with ".gz"
70
- *
71
- * resourceBase Set to replace the context resource base
72
- *
73
- * resourceCache If set, this is a context attribute name, which the servlet
74
- * will use to look for a shared ResourceCache instance.
75
- *
76
- * relativeResourceBase
77
- * Set with a pathname relative to the base of the
78
- * servlet context root. Useful for only serving static content out
79
- * of only specific subdirectories.
80
- *
81
- * aliases If True, aliases of resources are allowed (eg. symbolic
82
- * links and caps variations). May bypass security constraints.
83
- *
84
- * maxCacheSize The maximum total size of the cache or 0 for no cache.
85
- * maxCachedFileSize The maximum size of a file to cache
86
- * maxCachedFiles The maximum number of files to cache
87
- *
88
- * useFileMappedBuffer
89
- * If set to true, it will use mapped file buffer to serve static content
90
- * when using NIO connector. Setting this value to false means that
91
- * a direct buffer will be used instead of a mapped file buffer.
92
- * By default, this is set to true.
93
- *
94
- * cacheControl If set, all static content will have this value set as the cache-control
95
- * header.
96
- -->
97
-
98
-
99
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
100
- <servlet>
101
- <servlet-name>default</servlet-name>
102
- <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
103
- <init-param>
104
- <param-name>aliases</param-name>
105
- <param-value>false</param-value>
106
- </init-param>
107
- <init-param>
108
- <param-name>acceptRanges</param-name>
109
- <param-value>true</param-value>
110
- </init-param>
111
- <init-param>
112
- <param-name>dirAllowed</param-name>
113
- <param-value>false</param-value>
114
- </init-param>
115
- <init-param>
116
- <param-name>welcomeServlets</param-name>
117
- <param-value>false</param-value>
118
- </init-param>
119
- <init-param>
120
- <param-name>redirectWelcome</param-name>
121
- <param-value>false</param-value>
122
- </init-param>
123
- <init-param>
124
- <param-name>maxCacheSize</param-name>
125
- <param-value>256000000</param-value>
126
- </init-param>
127
- <init-param>
128
- <param-name>maxCachedFileSize</param-name>
129
- <param-value>200000000</param-value>
130
- </init-param>
131
- <init-param>
132
- <param-name>maxCachedFiles</param-name>
133
- <param-value>2048</param-value>
134
- </init-param>
135
- <init-param>
136
- <param-name>gzip</param-name>
137
- <param-value>true</param-value>
138
- </init-param>
139
- <init-param>
140
- <param-name>useFileMappedBuffer</param-name>
141
- <param-value>true</param-value>
142
- </init-param>
143
- <!--
144
- <init-param>
145
- <param-name>resourceCache</param-name>
146
- <param-value>resourceCache</param-value>
147
- </init-param>
148
- -->
149
- <!--
150
- <init-param>
151
- <param-name>cacheControl</param-name>
152
- <param-value>max-age=3600,public</param-value>
153
- </init-param>
154
- -->
155
- <load-on-startup>0</load-on-startup>
156
- </servlet>
157
-
158
- <servlet-mapping>
159
- <servlet-name>default</servlet-name>
160
- <url-pattern>/</url-pattern>
161
- </servlet-mapping>
162
-
163
- <!-- ==================================================================== -->
164
- <session-config>
165
- <session-timeout>30</session-timeout>
166
- </session-config>
167
-
168
- <!-- ==================================================================== -->
169
- <welcome-file-list>
170
- <welcome-file>index.html</welcome-file>
171
- <welcome-file>index.htm</welcome-file>
172
- </welcome-file-list>
173
-
174
- <!-- ==================================================================== -->
175
- <locale-encoding-mapping-list>
176
- <locale-encoding-mapping>
177
- <locale>ar</locale>
178
- <encoding>ISO-8859-6</encoding>
179
- </locale-encoding-mapping>
180
- <locale-encoding-mapping>
181
- <locale>be</locale>
182
- <encoding>ISO-8859-5</encoding>
183
- </locale-encoding-mapping>
184
- <locale-encoding-mapping>
185
- <locale>bg</locale>
186
- <encoding>ISO-8859-5</encoding>
187
- </locale-encoding-mapping>
188
- <locale-encoding-mapping>
189
- <locale>ca</locale>
190
- <encoding>ISO-8859-1</encoding>
191
- </locale-encoding-mapping>
192
- <locale-encoding-mapping>
193
- <locale>cs</locale>
194
- <encoding>ISO-8859-2</encoding>
195
- </locale-encoding-mapping>
196
- <locale-encoding-mapping>
197
- <locale>da</locale>
198
- <encoding>ISO-8859-1</encoding>
199
- </locale-encoding-mapping>
200
- <locale-encoding-mapping>
201
- <locale>de</locale>
202
- <encoding>ISO-8859-1</encoding>
203
- </locale-encoding-mapping>
204
- <locale-encoding-mapping>
205
- <locale>el</locale>
206
- <encoding>ISO-8859-7</encoding>
207
- </locale-encoding-mapping>
208
- <locale-encoding-mapping>
209
- <locale>en</locale>
210
- <encoding>ISO-8859-1</encoding>
211
- </locale-encoding-mapping>
212
- <locale-encoding-mapping>
213
- <locale>es</locale>
214
- <encoding>ISO-8859-1</encoding>
215
- </locale-encoding-mapping>
216
- <locale-encoding-mapping>
217
- <locale>et</locale>
218
- <encoding>ISO-8859-1</encoding>
219
- </locale-encoding-mapping>
220
- <locale-encoding-mapping>
221
- <locale>fi</locale>
222
- <encoding>ISO-8859-1</encoding>
223
- </locale-encoding-mapping>
224
- <locale-encoding-mapping>
225
- <locale>fr</locale>
226
- <encoding>ISO-8859-1</encoding>
227
- </locale-encoding-mapping>
228
- <locale-encoding-mapping>
229
- <locale>hr</locale>
230
- <encoding>ISO-8859-2</encoding>
231
- </locale-encoding-mapping>
232
- <locale-encoding-mapping>
233
- <locale>hu</locale>
234
- <encoding>ISO-8859-2</encoding>
235
- </locale-encoding-mapping>
236
- <locale-encoding-mapping>
237
- <locale>is</locale>
238
- <encoding>ISO-8859-1</encoding>
239
- </locale-encoding-mapping>
240
- <locale-encoding-mapping>
241
- <locale>it</locale>
242
- <encoding>ISO-8859-1</encoding>
243
- </locale-encoding-mapping>
244
- <locale-encoding-mapping>
245
- <locale>iw</locale>
246
- <encoding>ISO-8859-8</encoding>
247
- </locale-encoding-mapping>
248
- <locale-encoding-mapping>
249
- <locale>ja</locale>
250
- <encoding>Shift_JIS</encoding>
251
- </locale-encoding-mapping>
252
- <locale-encoding-mapping>
253
- <locale>ko</locale>
254
- <encoding>EUC-KR</encoding>
255
- </locale-encoding-mapping>
256
- <locale-encoding-mapping>
257
- <locale>lt</locale>
258
- <encoding>ISO-8859-2</encoding>
259
- </locale-encoding-mapping>
260
- <locale-encoding-mapping>
261
- <locale>lv</locale>
262
- <encoding>ISO-8859-2</encoding>
263
- </locale-encoding-mapping>
264
- <locale-encoding-mapping>
265
- <locale>mk</locale>
266
- <encoding>ISO-8859-5</encoding>
267
- </locale-encoding-mapping>
268
- <locale-encoding-mapping>
269
- <locale>nl</locale>
270
- <encoding>ISO-8859-1</encoding>
271
- </locale-encoding-mapping>
272
- <locale-encoding-mapping>
273
- <locale>no</locale>
274
- <encoding>ISO-8859-1</encoding>
275
- </locale-encoding-mapping>
276
- <locale-encoding-mapping>
277
- <locale>pl</locale>
278
- <encoding>ISO-8859-2</encoding>
279
- </locale-encoding-mapping>
280
- <locale-encoding-mapping>
281
- <locale>pt</locale>
282
- <encoding>ISO-8859-1</encoding>
283
- </locale-encoding-mapping>
284
- <locale-encoding-mapping>
285
- <locale>ro</locale>
286
- <encoding>ISO-8859-2</encoding>
287
- </locale-encoding-mapping>
288
- <locale-encoding-mapping>
289
- <locale>ru</locale>
290
- <encoding>ISO-8859-5</encoding>
291
- </locale-encoding-mapping>
292
- <locale-encoding-mapping>
293
- <locale>sh</locale>
294
- <encoding>ISO-8859-5</encoding>
295
- </locale-encoding-mapping>
296
- <locale-encoding-mapping>
297
- <locale>sk</locale>
298
- <encoding>ISO-8859-2</encoding>
299
- </locale-encoding-mapping>
300
- <locale-encoding-mapping>
301
- <locale>sl</locale>
302
- <encoding>ISO-8859-2</encoding>
303
- </locale-encoding-mapping>
304
- <locale-encoding-mapping>
305
- <locale>sq</locale>
306
- <encoding>ISO-8859-2</encoding>
307
- </locale-encoding-mapping>
308
- <locale-encoding-mapping>
309
- <locale>sr</locale>
310
- <encoding>ISO-8859-5</encoding>
311
- </locale-encoding-mapping>
312
- <locale-encoding-mapping>
313
- <locale>sv</locale>
314
- <encoding>ISO-8859-1</encoding>
315
- </locale-encoding-mapping>
316
- <locale-encoding-mapping>
317
- <locale>tr</locale>
318
- <encoding>ISO-8859-9</encoding>
319
- </locale-encoding-mapping>
320
- <locale-encoding-mapping>
321
- <locale>uk</locale>
322
- <encoding>ISO-8859-5</encoding>
323
- </locale-encoding-mapping>
324
- <locale-encoding-mapping>
325
- <locale>zh</locale>
326
- <encoding>GB2312</encoding>
327
- </locale-encoding-mapping>
328
- <locale-encoding-mapping>
329
- <locale>zh_TW</locale>
330
- <encoding>Big5</encoding>
331
- </locale-encoding-mapping>
332
- </locale-encoding-mapping-list>
333
-
334
- </web-app>
335
-