瀏覽代碼

Use tags to simplify the guide

Greg Turnquist 10 年之前
父節點
當前提交
384a9e64b5
共有 3 個檔案被更改,包括 13 行新增24 行删除
  1. 5
    24
      README.adoc
  2. 4
    0
      complete/build.gradle
  3. 4
    0
      complete/pom.xml

+ 5
- 24
README.adoc 查看文件

@@ -2,7 +2,7 @@
2 2
 tags: [spring-boot]
3 3
 projects: [spring-boot]
4 4
 ---
5
-:spring_boot_version: 0.5.0.M6
5
+:spring_boot_version: 1.0.0.RC3
6 6
 :spring-boot: https://github.com/spring-projects/spring-boot
7 7
 :toc:
8 8
 :icons: font
@@ -154,30 +154,14 @@ Change your `build.gradle` to exclude Tomcat then add Jetty to the list of depen
154 154
 
155 155
 [source,groovy]
156 156
 ----
157
-    compile("org.springframework.boot:spring-boot-starter-web:0.5.0.M6") {
158
-        exclude module: "spring-boot-starter-tomcat"
159
-    }
160
-    compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.M6")
157
+include::complete/build.gradle[tag=jetty]
161 158
 ----
162 159
 
163 160
 If you are using Maven, the changes look like this:
164 161
 
165 162
 [source,xml]
166 163
 ----
167
-        <dependency>
168
-            <groupId>org.springframework.boot</groupId>
169
-            <artifactId>spring-boot-starter-web</artifactId>
170
-            <exclusions>
171
-                <exclusion>
172
-                    <groupId>org.springframework.boot</groupId>
173
-                    <artifactId>spring-boot-starter-tomcat</artifactId>
174
-                </exclusion>
175
-            </exclusions>
176
-        </dependency>
177
-        <dependency>
178
-            <groupId>org.springframework.boot</groupId>
179
-            <artifactId>spring-boot-starter-jetty</artifactId>
180
-        </dependency>
164
+include::complete/pom.xml[tag=jetty]
181 165
 ----
182 166
 
183 167
 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 248
 
265 249
 [source,groovy]
266 250
 ----
267
-    compile("org.springframework.boot:spring-boot-starter-actuator:0.5.0.M6")
251
+include::complete/build.gradle[tag=actuator]
268 252
 ----
269 253
 
270 254
 If you are using Maven, add this to your list of dependencies:
271 255
 
272 256
 [source,xml]
273 257
 ----
274
-        <dependency>
275
-            <groupId>org.springframework.boot</groupId>
276
-            <artifactId>spring-boot-starter-actuator</artifactId>
277
-        </dependency>
258
+include::complete/pom.xml[tag=actuator]
278 259
 ----
279 260
 
280 261
 Then restart the app:

+ 4
- 0
complete/build.gradle 查看文件

@@ -24,11 +24,15 @@ repositories {
24 24
 }
25 25
 
26 26
 dependencies {
27
+    // tag::jetty[]
27 28
     compile("org.springframework.boot:spring-boot-starter-web:1.0.0.RC3") {
28 29
         exclude module: "spring-boot-starter-tomcat"
29 30
     }
30 31
     compile("org.springframework.boot:spring-boot-starter-jetty:1.0.0.RC3")
32
+    // end::jetty[]
33
+    // tag::actuator[]
31 34
     compile("org.springframework.boot:spring-boot-starter-actuator:1.0.0.RC3")
35
+    // end::actuator[]
32 36
     testCompile("junit:junit")
33 37
 }
34 38
 

+ 4
- 0
complete/pom.xml 查看文件

@@ -14,6 +14,7 @@
14 14
     </parent>
15 15
 
16 16
     <dependencies>
17
+	    <!-- tag::jetty[] -->
17 18
         <dependency>
18 19
             <groupId>org.springframework.boot</groupId>
19 20
             <artifactId>spring-boot-starter-web</artifactId>
@@ -28,10 +29,13 @@
28 29
             <groupId>org.springframework.boot</groupId>
29 30
             <artifactId>spring-boot-starter-jetty</artifactId>
30 31
         </dependency>
32
+        <!-- end::jetty[] -->
33
+        <!-- tag::actuator[] -->
31 34
         <dependency>
32 35
             <groupId>org.springframework.boot</groupId>
33 36
             <artifactId>spring-boot-starter-actuator</artifactId>
34 37
         </dependency>
38
+        <!-- end::actuator[] -->
35 39
     </dependencies>
36 40
 
37 41
     <properties>