0
点赞
收藏
分享

微信扫一扫

通过Maven快速搭建Spring Boot父工程

自由情感小屋 2022-04-17 阅读 74
spring boot
  1. 导入父工程maven依赖
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.0</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>
    </dependencies>
  1. 创建启动类
    在这里插入图片描述
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class PlusApplication {
    public static void main(String[] args) {
        SpringApplication.run(PlusApplication.class, args);
    }
}

  1. 写一个测试接口 测试能否成功即可
举报

相关推荐

0 条评论