Przeglądaj źródła

Add dual support

Greg Turnquist 13 lat temu
rodzic
commit
1f8cbf7c51
2 zmienionych plików z 79 dodań i 4 usunięć
  1. 38
    3
      README.ftl.md
  2. 41
    1
      README.md

+ 38
- 3
README.ftl.md Wyświetl plik

22
 
22
 
23
 <@create_directory_structure_hello/>
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
 Learn what you can do with Spring Boot
28
 Learn what you can do with Spring Boot
30
 --------------------------------------
29
 --------------------------------------
72
 $ ./gradlew build && java -jar build/libs/${project_id}-0.1.0.jar
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
 You should see some output like this:
80
 You should see some output like this:
76
 
81
 
77
 ```sh
82
 ```sh
125
 ---------------------------
130
 ---------------------------
126
 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!
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
 ```groovy
135
 ```groovy
131
     compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT")
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
 Add multipart upload support
148
 Add multipart upload support
135
 -------------------------------
149
 -------------------------------
136
 Suppose you want to add file upload support. To do that, update your configuration by adding a `MultipartConfigElement` to the application context.
150
 Suppose you want to add file upload support. To do that, update your configuration by adding a `MultipartConfigElement` to the application context.
148
 $ ./gradlew build && java -jar build/libs/${project_id}-0.1.0.jar
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
 Now check out the output:
171
 Now check out the output:
152
 
172
 
153
 ```sh
173
 ```sh
207
     compile("org.springframework.boot:spring-boot-starter-actuator:0.5.0.BUILD-SNAPSHOT")
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
 Then restart the app:
239
 Then restart the app:
211
 
240
 
212
 ```sh
241
 ```sh
213
 $ ./gradlew build && java -jar build/libs/${project_id}-0.1.0.jar
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
 You will see a new set of RESTful end points added to the application. These are management services provided by Spring Boot.
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
 ```sh
253
 ```sh

+ 41
- 1
README.md Wyświetl plik

50
             └── java
50
             └── java
51
                 └── hello
51
                 └── hello
52
 
52
 
53
+
53
 ### Create a Gradle build file
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
 `build.gradle`
57
 `build.gradle`
56
 ```gradle
58
 ```gradle
88
     gradleVersion = '1.7'
90
     gradleVersion = '1.7'
89
 }
91
 }
90
 ```
92
 ```
93
+    
94
+    
91
 
95
 
92
 Learn what you can do with Spring Boot
96
 Learn what you can do with Spring Boot
93
 --------------------------------------
97
 --------------------------------------
184
 $ ./gradlew build && java -jar build/libs/gs-spring-boot-0.1.0.jar
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
 You should see some output like this:
197
 You should see some output like this:
188
 
198
 
189
 ```sh
199
 ```sh
237
 ---------------------------
247
 ---------------------------
238
 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!
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
 ```groovy
252
 ```groovy
243
     compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT")
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
 Add multipart upload support
265
 Add multipart upload support
247
 -------------------------------
266
 -------------------------------
248
 Suppose you want to add file upload support. To do that, update your configuration by adding a `MultipartConfigElement` to the application context.
267
 Suppose you want to add file upload support. To do that, update your configuration by adding a `MultipartConfigElement` to the application context.
300
 $ ./gradlew build && java -jar build/libs/gs-spring-boot-0.1.0.jar
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
 Now check out the output:
328
 Now check out the output:
304
 
329
 
305
 ```sh
330
 ```sh
359
     compile("org.springframework.boot:spring-boot-starter-actuator:0.5.0.BUILD-SNAPSHOT")
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
 Then restart the app:
396
 Then restart the app:
363
 
397
 
364
 ```sh
398
 ```sh
365
 $ ./gradlew build && java -jar build/libs/gs-spring-boot-0.1.0.jar
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
 You will see a new set of RESTful end points added to the application. These are management services provided by Spring Boot.
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
 ```sh
410
 ```sh