Change default version of Jetty to 9.3

Closes gh-5825
This commit is contained in:
Andy Wilkinson
2016-06-14 17:20:13 +01:00
parent e1cafb16ba
commit ff602e60a0
13 changed files with 113 additions and 66 deletions

View File

@@ -37,9 +37,9 @@ diverge from the defaults.
[[getting-started-system-requirements]]
== System Requirements
By default, Spring Boot {spring-boot-version} requires http://www.java.com[Java 7] and
Spring Framework {spring-version} or above. You can use Spring Boot with Java 6 with some additional
configuration. See <<howto.adoc#howto-use-java-6>> for more details. Explicit build support
is provided for Maven (3.2+) and Gradle (1.12+).
Spring Framework {spring-version} or above. You can use Spring Boot with Java 6 with some
additional configuration. See <<howto.adoc#howto-use-java-6>> for more details. Explicit
build support is provided for Maven (3.2+) and Gradle (1.12+).
TIP: Although you can use Spring Boot with Java 6 or 7, we generally recommend Java 8 if at
all possible.
@@ -58,7 +58,11 @@ The following embedded servlet containers are supported out of the box:
|3.0
|Java 6+
|Jetty 9
|Jetty 9.3
|3.1
|Java 8+
|Jetty 9.2
|3.1
|Java 7+

View File

@@ -920,10 +920,67 @@ You can change the Tomcat version by setting the `tomcat.version` property:
[[howto-use-jetty-9.2]]
=== Use Jetty 9.2
Jetty 9.2 works with Spring Boot, but the default is to use Jetty 9.3. If you cannot use
Jetty 9.3 (for example, because you are using Java 7) you will need to change your
classpath to reference Jetty 9.2.
[[howto-use-jetty-9.2-maven]]
==== Use Jetty 9.2 with Maven
If you are using the starters and parent you can just add the Jetty starter and override
the `jetty.version` property:
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
----
<properties>
<jetty.version>9.2.17.v20160517</jetty.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
</dependencies>
----
[[howto-use-jetty-9.2-gradle]]
==== Use Jetty 9.2 with Gradle
You can set the `jetty.version` property. For example, for a simple webapp or service:
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
----
ext['jetty.version'] = '9.2.17.v20160517'
dependencies {
compile ('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
}
compile ('org.springframework.boot:spring-boot-starter-jetty')
}
----
[[howto-use-jetty-8]]
=== Use Jetty 8
Jetty 8 works with Spring Boot, but the default is to use Jetty 9. If you cannot use
Jetty 9 (for example, because you are using Java 1.6) you will need to change your
Jetty 8 works with Spring Boot, but the default is to use Jetty 9.3. If you cannot use
Jetty 9.3 (for example, because you are using Java 1.6) you will need to change your
classpath to reference Jetty 8. You will also need to exclude Jetty's WebSocket-related
dependencies.