Ver código fonte

Add dual support

Greg Turnquist 13 anos atrás
pai
commit
1f8cbf7c51
2 arquivos alterados com 79 adições e 4 exclusões
  1. 38
    3
      README.ftl.md
  2. 41
    1
      README.md

+ 38
- 3
README.ftl.md Ver arquivo

@@ -22,9 +22,8 @@ Set up the project
22 22
 
23 23
 <@create_directory_structure_hello/>
24 24
 
25
-### Create a Gradle build file
26 25
 
27
-    <@snippet path="build.gradle" prefix="initial"/>
26
+<@create_both_builds/>
28 27
 
29 28
 Learn what you can do with Spring Boot
30 29
 --------------------------------------
@@ -72,6 +71,12 @@ To run the application, execute:
72 71
 $ ./gradlew build && java -jar build/libs/${project_id}-0.1.0.jar
73 72
 ```
74 73
 
74
+If you are using Maven, execute:
75
+
76
+```sh
77
+$ mvn package && java -jar target/${project_id}-0.1.0.jar
78
+```
79
+
75 80
 You should see some output like this:
76 81
 
77 82
 ```sh
@@ -125,12 +130,21 @@ Switch from Tomcat to Jetty
125 130
 ---------------------------
126 131
 What if you prefer Jetty over Tomcat? Jetty and Tomcat are both compliant servlet containers, so it should be easy to switch. With Spring Boot, it is!
127 132
 
128
-Add this to your build file's list of dependencies:
133
+Add this to your `build.gradle` list of dependencies:
129 134
 
130 135
 ```groovy
131 136
     compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT")
132 137
 ```
133 138
 
139
+If you are using Maven, add this to your list of dependencies:
140
+
141
+```xml
142
+        <dependency>
143
+            <groupId>org.springframework.boot</groupId>
144
+            <artifactId>spring-boot-starter-jetty</artifactId>
145
+        </dependency>
146
+```
147
+
134 148
 Add multipart upload support
135 149
 -------------------------------
136 150
 Suppose you want to add file upload support. To do that, update your configuration by adding a `MultipartConfigElement` to the application context.
@@ -148,6 +162,12 @@ Run the app again:
148 162
 $ ./gradlew build && java -jar build/libs/${project_id}-0.1.0.jar
149 163
 ```
150 164
 
165
+If you are using Maven, execute:
166
+
167
+```sh
168
+$ mvn package && java -jar target/${project_id}-0.1.0.jar
169
+```
170
+
151 171
 Now check out the output:
152 172
 
153 173
 ```sh
@@ -207,12 +227,27 @@ Add this to your build file's list of dependencies:
207 227
     compile("org.springframework.boot:spring-boot-starter-actuator:0.5.0.BUILD-SNAPSHOT")
208 228
 ```
209 229
 
230
+If you are using Maven, add this to your list of dependencies:
231
+
232
+```xml
233
+        <dependency>
234
+            <groupId>org.springframework.boot</groupId>
235
+            <artifactId>spring-boot-starter-actuator</artifactId>
236
+        </dependency>
237
+```
238
+
210 239
 Then restart the app:
211 240
 
212 241
 ```sh
213 242
 $ ./gradlew build && java -jar build/libs/${project_id}-0.1.0.jar
214 243
 ```
215 244
 
245
+If you are using Maven, execute:
246
+
247
+```sh
248
+$ mvn package && java -jar target/${project_id}-0.1.0.jar
249
+```
250
+
216 251
 You will see a new set of RESTful end points added to the application. These are management services provided by Spring Boot.
217 252
 
218 253
 ```sh

+ 41
- 1
README.md Ver arquivo

@@ -50,7 +50,9 @@ In a project directory of your choosing, create the following subdirectory struc
50 50
             └── java
51 51
                 └── hello
52 52
 
53
+
53 54
 ### Create a Gradle build file
55
+Below is the [initial Gradle build file](https://github.com/springframework-meta/gs-spring-boot/blob/master/initial/build.gradle). But you can also use Maven. The pom.xml file is included [right here](https://github.com/springframework-meta/gs-spring-boot/blob/master/initial/pom.xml).
54 56
 
55 57
 `build.gradle`
56 58
 ```gradle
@@ -88,6 +90,8 @@ task wrapper(type: Wrapper) {
88 90
     gradleVersion = '1.7'
89 91
 }
90 92
 ```
93
+    
94
+    
91 95
 
92 96
 Learn what you can do with Spring Boot
93 97
 --------------------------------------
@@ -184,6 +188,12 @@ To run the application, execute:
184 188
 $ ./gradlew build && java -jar build/libs/gs-spring-boot-0.1.0.jar
185 189
 ```
186 190
 
191
+If you are using Maven, execute:
192
+
193
+```sh
194
+$ mvn package && java -jar target/gs-spring-boot-0.1.0.jar
195
+```
196
+
187 197
 You should see some output like this:
188 198
 
189 199
 ```sh
@@ -237,12 +247,21 @@ Switch from Tomcat to Jetty
237 247
 ---------------------------
238 248
 What if you prefer Jetty over Tomcat? Jetty and Tomcat are both compliant servlet containers, so it should be easy to switch. With Spring Boot, it is!
239 249
 
240
-Add this to your build file's list of dependencies:
250
+Add this to your `build.gradle` list of dependencies:
241 251
 
242 252
 ```groovy
243 253
     compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT")
244 254
 ```
245 255
 
256
+If you are using Maven, add this to your list of dependencies:
257
+
258
+```xml
259
+        <dependency>
260
+            <groupId>org.springframework.boot</groupId>
261
+            <artifactId>spring-boot-starter-jetty</artifactId>
262
+        </dependency>
263
+```
264
+
246 265
 Add multipart upload support
247 266
 -------------------------------
248 267
 Suppose you want to add file upload support. To do that, update your configuration by adding a `MultipartConfigElement` to the application context.
@@ -300,6 +319,12 @@ Run the app again:
300 319
 $ ./gradlew build && java -jar build/libs/gs-spring-boot-0.1.0.jar
301 320
 ```
302 321
 
322
+If you are using Maven, execute:
323
+
324
+```sh
325
+$ mvn package && java -jar target/gs-spring-boot-0.1.0.jar
326
+```
327
+
303 328
 Now check out the output:
304 329
 
305 330
 ```sh
@@ -359,12 +384,27 @@ Add this to your build file's list of dependencies:
359 384
     compile("org.springframework.boot:spring-boot-starter-actuator:0.5.0.BUILD-SNAPSHOT")
360 385
 ```
361 386
 
387
+If you are using Maven, add this to your list of dependencies:
388
+
389
+```xml
390
+        <dependency>
391
+            <groupId>org.springframework.boot</groupId>
392
+            <artifactId>spring-boot-starter-actuator</artifactId>
393
+        </dependency>
394
+```
395
+
362 396
 Then restart the app:
363 397
 
364 398
 ```sh
365 399
 $ ./gradlew build && java -jar build/libs/gs-spring-boot-0.1.0.jar
366 400
 ```
367 401
 
402
+If you are using Maven, execute:
403
+
404
+```sh
405
+$ mvn package && java -jar target/gs-spring-boot-0.1.0.jar
406
+```
407
+
368 408
 You will see a new set of RESTful end points added to the application. These are management services provided by Spring Boot.
369 409
 
370 410
 ```sh