spring boot 基本依赖引入

来源:互联网 发布:程序员离职 编辑:程序博客网 时间:2024/06/06 03:22

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);
    }
}


原创粉丝点击