46
社区成员




1.1创建spring项目
1.2 标准项目结构图如下
1.3 添加springboot-parent
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.3</version>
<relativePath/>
</parent>
1.4 添加 spring-boot-start-web
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
1.5 添加 Lambok 依赖
<!-- lombok 依赖 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
1.6 SpringBoot 打包插件
<!-- SpringBoot 打包插件 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
@SpringBootApplication
@MapperScan("com.qidong")
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}