这里,利用eclipse或者idea提供的springboot项目创建向导,不用去找依赖。
普通的eclipse需要安装spring插件。可以直接使用sts版本。全称是Spring Tools Suite。在eclipse下,新建->Spring Starter Project,跟着向导,选择项目位置,填写项目名称。
下一步,选择Spring Web,MyBatis Framework,PostgreSQL Driver三个依赖即可。
pom.xml主要内容,其中junit是手动添加:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.xx</groupId>
<artifactId>springmybatis</artifactId>
<version>1.0</version>
<name>springmybatis</name>
<description>Demo project for Spring Boot</description>