提交 384a9e64 编写于 作者: G Greg Turnquist

Use tags to simplify the guide

上级 246eb4f2
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
tags: [spring-boot] tags: [spring-boot]
projects: [spring-boot] projects: [spring-boot]
--- ---
:spring_boot_version: 0.5.0.M6 :spring_boot_version: 1.0.0.RC3
:spring-boot: https://github.com/spring-projects/spring-boot :spring-boot: https://github.com/spring-projects/spring-boot
:toc: :toc:
:icons: font :icons: font
...@@ -154,30 +154,14 @@ Change your `build.gradle` to exclude Tomcat then add Jetty to the list of depen ...@@ -154,30 +154,14 @@ Change your `build.gradle` to exclude Tomcat then add Jetty to the list of depen
[source,groovy] [source,groovy]
---- ----
compile("org.springframework.boot:spring-boot-starter-web:0.5.0.M6") { include::complete/build.gradle[tag=jetty]
exclude module: "spring-boot-starter-tomcat"
}
compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.M6")
---- ----
If you are using Maven, the changes look like this: If you are using Maven, the changes look like this:
[source,xml] [source,xml]
---- ----
<dependency> include::complete/pom.xml[tag=jetty]
<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>
---- ----
This change isn't about comparing Tomcat vs. Jetty. Instead, it demonstrates how Spring Boot reacts to what is on your classpath. This change isn't about comparing Tomcat vs. Jetty. Instead, it demonstrates how Spring Boot reacts to what is on your classpath.
...@@ -264,17 +248,14 @@ Add this to your build file's list of dependencies: ...@@ -264,17 +248,14 @@ Add this to your build file's list of dependencies:
[source,groovy] [source,groovy]
---- ----
compile("org.springframework.boot:spring-boot-starter-actuator:0.5.0.M6") include::complete/build.gradle[tag=actuator]
---- ----
If you are using Maven, add this to your list of dependencies: If you are using Maven, add this to your list of dependencies:
[source,xml] [source,xml]
---- ----
<dependency> include::complete/pom.xml[tag=actuator]
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
---- ----
Then restart the app: Then restart the app:
......
...@@ -24,11 +24,15 @@ repositories { ...@@ -24,11 +24,15 @@ repositories {
} }
dependencies { dependencies {
// tag::jetty[]
compile("org.springframework.boot:spring-boot-starter-web:1.0.0.RC3") { compile("org.springframework.boot:spring-boot-starter-web:1.0.0.RC3") {
exclude module: "spring-boot-starter-tomcat" exclude module: "spring-boot-starter-tomcat"
} }
compile("org.springframework.boot:spring-boot-starter-jetty:1.0.0.RC3") compile("org.springframework.boot:spring-boot-starter-jetty:1.0.0.RC3")
// end::jetty[]
// tag::actuator[]
compile("org.springframework.boot:spring-boot-starter-actuator:1.0.0.RC3") compile("org.springframework.boot:spring-boot-starter-actuator:1.0.0.RC3")
// end::actuator[]
testCompile("junit:junit") testCompile("junit:junit")
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
</parent> </parent>
<dependencies> <dependencies>
<!-- tag::jetty[] -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
...@@ -28,10 +29,13 @@ ...@@ -28,10 +29,13 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId> <artifactId>spring-boot-starter-jetty</artifactId>
</dependency> </dependency>
<!-- end::jetty[] -->
<!-- tag::actuator[] -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId> <artifactId>spring-boot-starter-actuator</artifactId>
</dependency> </dependency>
<!-- end::actuator[] -->
</dependencies> </dependencies>
<properties> <properties>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册