Преглед на файлове

Fixed some small issues that made the 'start' version not runnable at the end.

The 'start' version has missing bits in the pom.xml as well as differences in what
the guide said. After comparing with 'complete', made the fixes and updated the
guide appropriately so it should work top-to-bottom if you use 'start' and really
copy-n-paste your way along.
Greg Turnquist преди 13 години
родител
ревизия
c9b1aa89bb
променени са 3 файла, в които са добавени 57 реда и са изтрити 37 реда
  1. 52
    29
      README.md
  2. 5
    1
      start/pom.xml
  3. 0
    7
      start/src/main/java/hello/HelloWorldConfiguration.java

+ 52
- 29
README.md Целия файл

@@ -50,35 +50,51 @@ Create a Maven POM that looks like this:
50 50
 ```xml
51 51
 <?xml version="1.0" encoding="UTF-8"?>
52 52
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
53
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
54
-    <modelVersion>4.0.0</modelVersion>
55
-
56
-    <groupId>org.springframework</groupId>
57
-    <artifactId>gs-rest-service</artifactId>
58
-    <version>1.0-SNAPSHOT</version>
59
-
60
-    <parent>
61
-        <groupId>org.springframework.bootstrap</groupId>
62
-        <artifactId>spring-bootstrap-starters</artifactId>
63
-        <version>0.5.0.BUILD-SNAPSHOT</version>
64
-    </parent>
65
-
66
-    <dependencies>
67
-        <dependency>
68
-            <groupId>org.springframework.bootstrap</groupId>
69
-            <artifactId>spring-bootstrap-web-starter</artifactId>
70
-        </dependency>
71
-    </dependencies>
72
-
73
-    <!-- TODO: remove once bootstrap goes GA -->
74
-    <repositories>
75
-        <repository>
76
-            <id>spring-snapshots</id>
77
-            <name>Spring Snapshots</name>
78
-            <url>http://repo.springsource.org/snapshot</url>
79
-            <snapshots><enabled>true</enabled></snapshots>
80
-        </repository>
81
-    </repositories>
53
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
54
+	<modelVersion>4.0.0</modelVersion>
55
+
56
+	<groupId>org.springframework</groupId>
57
+	<artifactId>gs-rest-service</artifactId>
58
+	<version>0.0.1-SNAPSHOT</version>
59
+
60
+	<parent>
61
+		<groupId>org.springframework.bootstrap</groupId>
62
+		<artifactId>spring-bootstrap-starters</artifactId>
63
+		<version>0.5.0.BUILD-SNAPSHOT</version>
64
+	</parent>
65
+
66
+	<dependencies>
67
+		<dependency>
68
+			<groupId>org.springframework.bootstrap</groupId>
69
+			<artifactId>spring-bootstrap-web-starter</artifactId>
70
+		</dependency>
71
+		<dependency>
72
+			<groupId>com.fasterxml.jackson.core</groupId>
73
+			<artifactId>jackson-databind</artifactId>
74
+		</dependency>
75
+	</dependencies>
76
+
77
+	<!-- TODO: remove once bootstrap goes GA -->
78
+	<repositories>
79
+		<repository>
80
+			<id>spring-snapshots</id>
81
+			<name>Spring Snapshots</name>
82
+			<url>http://repo.springsource.org/snapshot</url>
83
+			<snapshots>
84
+				<enabled>true</enabled>
85
+			</snapshots>
86
+		</repository>
87
+	</repositories>
88
+	<pluginRepositories>
89
+		<pluginRepository>
90
+			<id>spring-snapshots</id>
91
+			<name>Spring Snapshots</name>
92
+			<url>http://repo.springsource.org/snapshot</url>
93
+			<snapshots>
94
+				<enabled>true</enabled>
95
+			</snapshots>
96
+		</pluginRepository>
97
+	</pluginRepositories>
82 98
 
83 99
 </project>
84 100
 ```
@@ -242,6 +258,13 @@ Add the following to your `pom.xml` file (keeping any existing properties or plu
242 258
 
243 259
 `pom.xml`
244 260
 ```xml
261
+<properties>
262
+	<!-- use UTF-8 for everything -->
263
+	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
264
+	<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
265
+	<start-class>hello.HelloWorldConfiguration</start-class>
266
+</properties>
267
+
245 268
 <build>
246 269
     <plugins>
247 270
         <plugin>

+ 5
- 1
start/pom.xml Целия файл

@@ -5,7 +5,7 @@
5 5
 
6 6
 	<groupId>org.springframework</groupId>
7 7
 	<artifactId>gs-rest-service</artifactId>
8
-	<version>1.0-SNAPSHOT</version>
8
+	<version>0.0.1-SNAPSHOT</version>
9 9
 
10 10
 	<parent>
11 11
 		<groupId>org.springframework.bootstrap</groupId>
@@ -18,6 +18,10 @@
18 18
 			<groupId>org.springframework.bootstrap</groupId>
19 19
 			<artifactId>spring-bootstrap-web-starter</artifactId>
20 20
 		</dependency>
21
+		<dependency>
22
+			<groupId>com.fasterxml.jackson.core</groupId>
23
+			<artifactId>jackson-databind</artifactId>
24
+		</dependency>
21 25
 	</dependencies>
22 26
 
23 27
 	<!-- TODO: remove once bootstrap goes GA -->

+ 0
- 7
start/src/main/java/hello/HelloWorldConfiguration.java Целия файл

@@ -1,19 +1,12 @@
1 1
 package hello;
2 2
 
3
-import org.springframework.bootstrap.SpringApplication;
4
-import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
5 3
 import org.springframework.context.annotation.ComponentScan;
6 4
 import org.springframework.context.annotation.Configuration;
7 5
 import org.springframework.web.servlet.config.annotation.EnableWebMvc;
8 6
 
9 7
 @Configuration
10
-@EnableAutoConfiguration
11 8
 @EnableWebMvc
12 9
 @ComponentScan
13 10
 public class HelloWorldConfiguration {
14 11
 	
15
-	public static void main(String[] args) {
16
-		SpringApplication.run(HelloWorldConfiguration.class, args);
17
-	}
18
-
19 12
 }