spring boot 基本依賴引入
阿新 • • 發佈:2019-01-01
1.基礎核心依賴
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.1.RELEASE</version> </parent>
2.web應用依賴
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
3.使用freemark依賴(不和web應用依賴共存)
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
</dependencies>
模版 templates/model.ftl
4.spring boot 應用啟動入口(註解)
@SpringBootApplication
public class StartApplication
{
public static void main(String[] args)
{
SpringApplication.run(StartApplication.class,args);
}
}