Pārlūkot izejas kodu

Initial commit of Spring Boot guide

Greg Turnquist 13 gadus atpakaļ
revīzija
2f5af0f008

+ 13
- 0
.gitignore Parādīt failu

1
+*.sw?
2
+.#*
3
+*#
4
+*~
5
+.classpath
6
+.project
7
+.settings
8
+bin
9
+build
10
+target
11
+dependency-reduced-pom.xml
12
+*.sublime-*
13
+/scratch

+ 55
- 0
complete/pom.xml Parādīt failu

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+    <modelVersion>4.0.0</modelVersion>
5
+
6
+    <groupId>org.springframework</groupId>
7
+    <artifactId>gs-spring-boot-complete</artifactId>
8
+    <version>0.1.0</version>
9
+
10
+    <parent>
11
+        <groupId>org.springframework.boot</groupId>
12
+        <artifactId>spring-boot-up-parent</artifactId>
13
+        <version>0.5.0.BUILD-SNAPSHOT</version>
14
+    </parent>
15
+
16
+    <dependencies>
17
+        <dependency>
18
+            <groupId>org.springframework.boot</groupId>
19
+            <artifactId>spring-boot-up-web</artifactId>
20
+        </dependency>
21
+        <dependency>
22
+            <groupId>com.fasterxml.jackson.core</groupId>
23
+            <artifactId>jackson-databind</artifactId>
24
+        </dependency>
25
+    </dependencies>
26
+
27
+    <properties>
28
+        <start-class>hello.Application</start-class>
29
+    </properties>
30
+
31
+    <build>
32
+        <plugins>
33
+            <plugin>
34
+                <groupId>org.springframework.boot</groupId>
35
+                <artifactId>spring-boot-maven-plugin</artifactId>
36
+            </plugin>
37
+        </plugins>
38
+    </build>
39
+
40
+    <!-- TODO: remove once bootstrap goes GA -->
41
+    <repositories>
42
+        <repository>
43
+            <id>spring-snapshots</id>
44
+            <url>http://repo.springsource.org/snapshot</url>
45
+            <snapshots><enabled>true</enabled></snapshots>
46
+        </repository>
47
+    </repositories>
48
+    <pluginRepositories>
49
+        <pluginRepository>
50
+            <id>spring-snapshots</id>
51
+            <url>http://repo.springsource.org/snapshot</url>
52
+            <snapshots><enabled>true</enabled></snapshots>
53
+        </pluginRepository>
54
+    </pluginRepositories>
55
+</project>

+ 19
- 0
complete/src/main/java/hello/Application.java Parādīt failu

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

+ 15
- 0
complete/src/main/java/hello/HelloController.java Parādīt failu

1
+package hello;
2
+
3
+import org.springframework.stereotype.Controller;
4
+import org.springframework.web.bind.annotation.RequestMapping;
5
+import org.springframework.web.bind.annotation.ResponseBody;
6
+
7
+@Controller
8
+public class HelloController {
9
+
10
+	@RequestMapping("/")
11
+	public @ResponseBody String index() {
12
+		return "Greetings from Spring Boot!";
13
+	}
14
+	
15
+}

+ 42
- 0
initial/pom.xml Parādīt failu

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+    <modelVersion>4.0.0</modelVersion>
5
+
6
+    <groupId>org.springframework</groupId>
7
+    <artifactId>gs-spring-boot-initial</artifactId>
8
+    <version>0.1.0</version>
9
+
10
+    <parent>
11
+        <groupId>org.springframework.boot</groupId>
12
+        <artifactId>spring-boot-up-parent</artifactId>
13
+        <version>0.5.0.BUILD-SNAPSHOT</version>
14
+    </parent>
15
+
16
+    <dependencies>
17
+        <dependency>
18
+            <groupId>org.springframework.boot</groupId>
19
+            <artifactId>spring-boot-up-web</artifactId>
20
+        </dependency>
21
+        <dependency>
22
+            <groupId>com.fasterxml.jackson.core</groupId>
23
+            <artifactId>jackson-databind</artifactId>
24
+        </dependency>
25
+    </dependencies>
26
+
27
+    <!-- TODO: remove once bootstrap goes GA -->
28
+    <repositories>
29
+        <repository>
30
+            <id>spring-snapshots</id>
31
+            <url>http://repo.springsource.org/snapshot</url>
32
+            <snapshots><enabled>true</enabled></snapshots>
33
+        </repository>
34
+    </repositories>
35
+    <pluginRepositories>
36
+        <pluginRepository>
37
+            <id>spring-snapshots</id>
38
+            <url>http://repo.springsource.org/snapshot</url>
39
+            <snapshots><enabled>true</enabled></snapshots>
40
+        </pluginRepository>
41
+    </pluginRepositories>
42
+</project>

+ 0
- 0
initial/src/main/java/hello/.gitignore Parādīt failu