Explorar el Código

Upgrade to Spring Boot

Greg Turnquist hace 13 años
padre
commit
edf501cd7d
Se han modificado 4 ficheros con 29 adiciones y 24 borrados
  1. 17
    12
      README.md
  2. 6
    6
      complete/pom.xml
  3. 2
    2
      complete/src/main/java/hello/Application.java
  4. 4
    4
      initial/pom.xml

+ 17
- 12
README.md Ver fichero

@@ -82,15 +82,15 @@ In a project directory of your choosing, create the following subdirectory struc
82 82
     <version>0.1.0</version>
83 83
 
84 84
     <parent>
85
-        <groupId>org.springframework.zero</groupId>
86
-        <artifactId>spring-starter-parent</artifactId>
85
+        <groupId>org.springframework.boot</groupId>
86
+        <artifactId>spring-boot-up-parent</artifactId>
87 87
         <version>0.5.0.BUILD-SNAPSHOT</version>
88 88
     </parent>
89 89
 
90 90
     <dependencies>
91 91
         <dependency>
92
-            <groupId>org.springframework.zero</groupId>
93
-            <artifactId>spring-starter-web</artifactId>
92
+            <groupId>org.springframework.boot</groupId>
93
+            <artifactId>spring-boot-up-web</artifactId>
94 94
         </dependency>
95 95
         <dependency>
96 96
             <groupId>com.fasterxml.jackson.core</groupId>
@@ -116,7 +116,7 @@ In a project directory of your choosing, create the following subdirectory struc
116 116
 </project>
117 117
 ```
118 118
 
119
-TODO: mention that we're using Spring Bootstrap's [_starter POMs_](../gs-bootstrap-starter) here.
119
+TODO: mention that we're using Spring Boot's [_starter POMs_](../gs-bootstrap-starter) here.
120 120
 
121 121
 Note to experienced Maven users who are unaccustomed to using an external parent project: you can take it out later, it's just there to reduce the amount of code you have to write to get started.
122 122
 
@@ -229,8 +229,8 @@ Although it is possible to package this service as a traditional [WAR][u-war] fi
229 229
 ```java
230 230
 package hello;
231 231
 
232
-import org.springframework.autoconfigure.EnableAutoConfiguration;
233
-import org.springframework.bootstrap.SpringApplication;
232
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
233
+import org.springframework.boot.SpringApplication;
234 234
 import org.springframework.context.annotation.ComponentScan;
235 235
 
236 236
 @ComponentScan
@@ -264,8 +264,8 @@ Add the following configuration to your existing Maven POM:
264 264
     <build>
265 265
         <plugins>
266 266
             <plugin>
267
-                <groupId>org.springframework.zero</groupId>
268
-                <artifactId>spring-package-maven-plugin</artifactId>
267
+                <groupId>org.springframework.boot</groupId>
268
+                <artifactId>spring-boot-maven-plugin</artifactId>
269 269
             </plugin>
270 270
         </plugins>
271 271
     </build>
@@ -273,15 +273,20 @@ Add the following configuration to your existing Maven POM:
273 273
 
274 274
 The `start-class` property tells Maven to create a `META-INF/MANIFEST.MF` file with a `Main-Class: hello.Application` entry. This entry enables you to run the jar with `java -jar`.
275 275
 
276
-The [Spring Package maven plugin][spring-package-maven-plugin] collects all the jars on the classpath and builds a single "über-jar", which makes it more convenient to execute and transport your service.
276
+The [Spring Boot maven plugin][spring-boot-maven-plugin] collects all the jars on the classpath and builds a single "über-jar", which makes it more convenient to execute and transport your service.
277 277
 
278
-Now run the following to produce a single executable JAR file containing all necessary dependency classes and resources:
278
+Now run the following command to produce a single executable JAR file containing all necessary dependency classes and resources:
279 279
 
280 280
 ```sh
281 281
 $ mvn package
282 282
 ```
283 283
 
284
-[spring-package-maven-plugin]: https://github.com/SpringSource/spring-zero/tree/master/spring-package-maven-plugin
284
+To run the package, run this:
285
+```sh
286
+$ mvn spring-boot:run
287
+```
288
+
289
+[spring-boot-maven-plugin]: https://github.com/SpringSource/spring-boot/tree/master/spring-boot-maven-plugin
285 290
 
286 291
 > **Note:** The procedure above will create a runnable JAR. You can also opt to [build a classic WAR file](/guides/gs/convert-jar-to-war/content) instead.
287 292
 

+ 6
- 6
complete/pom.xml Ver fichero

@@ -8,15 +8,15 @@
8 8
     <version>0.1.0</version>
9 9
 
10 10
     <parent>
11
-        <groupId>org.springframework.zero</groupId>
12
-        <artifactId>spring-starter-parent</artifactId>
11
+        <groupId>org.springframework.boot</groupId>
12
+        <artifactId>spring-boot-up-parent</artifactId>
13 13
         <version>0.5.0.BUILD-SNAPSHOT</version>
14 14
     </parent>
15 15
 
16 16
     <dependencies>
17 17
         <dependency>
18
-            <groupId>org.springframework.zero</groupId>
19
-            <artifactId>spring-starter-web</artifactId>
18
+            <groupId>org.springframework.boot</groupId>
19
+            <artifactId>spring-boot-up-web</artifactId>
20 20
         </dependency>
21 21
         <dependency>
22 22
             <groupId>com.fasterxml.jackson.core</groupId>
@@ -31,8 +31,8 @@
31 31
     <build>
32 32
         <plugins>
33 33
             <plugin>
34
-                <groupId>org.springframework.zero</groupId>
35
-                <artifactId>spring-package-maven-plugin</artifactId>
34
+                <groupId>org.springframework.boot</groupId>
35
+                <artifactId>spring-boot-maven-plugin</artifactId>
36 36
             </plugin>
37 37
         </plugins>
38 38
     </build>

+ 2
- 2
complete/src/main/java/hello/Application.java Ver fichero

@@ -1,7 +1,7 @@
1 1
 package hello;
2 2
 
3
-import org.springframework.autoconfigure.EnableAutoConfiguration;
4
-import org.springframework.bootstrap.SpringApplication;
3
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
4
+import org.springframework.boot.SpringApplication;
5 5
 import org.springframework.context.annotation.ComponentScan;
6 6
 
7 7
 @ComponentScan

+ 4
- 4
initial/pom.xml Ver fichero

@@ -8,15 +8,15 @@
8 8
     <version>0.1.0</version>
9 9
 
10 10
     <parent>
11
-        <groupId>org.springframework.zero</groupId>
12
-        <artifactId>spring-starter-parent</artifactId>
11
+        <groupId>org.springframework.boot</groupId>
12
+        <artifactId>spring-boot-up-parent</artifactId>
13 13
         <version>0.5.0.BUILD-SNAPSHOT</version>
14 14
     </parent>
15 15
 
16 16
     <dependencies>
17 17
         <dependency>
18
-            <groupId>org.springframework.zero</groupId>
19
-            <artifactId>spring-starter-web</artifactId>
18
+            <groupId>org.springframework.boot</groupId>
19
+            <artifactId>spring-boot-up-web</artifactId>
20 20
         </dependency>
21 21
         <dependency>
22 22
             <groupId>com.fasterxml.jackson.core</groupId>