pom文件web
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.yy</groupId> <artifactId>blog</artifactId> <version>1.0-SNAPSHOT</version> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.6.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> </project>
啓動類spring
// 此註解代表這是一個啓動類,注意,全部的註解必須在這個啓動類的下級或者同級目錄 // 由於Springboot是從這個註解開始往下掃描的 @EnableAutoConfiguration public class ApplicationStart { public static void main(String[] args) { SpringApplication.run(ApplicationStart.class); } }