当前位置: 代码迷 >> 综合 >> 创建一个spring boot项目,简易过程总结
  详细解决方案

创建一个spring boot项目,简易过程总结

热度:32   发布时间:2023-10-16 14:11:03.0

1.  new -->project --> spring initializer --> 一路 next

2. 在 settings  对maven进行相应的配置;对jdk进行配置

3. pom.xml文件中添加相应的依赖

4. 创建  generatorConfig.xml配置文件(我这里用到了 mybatis)

5. 配置 application.xml文件

启动,先右边 maven,找到 mybatis-generator,双击运行,生成 pojo 与 mapper 以及  xml文件

6. 启动类上添加

@MapperScan("com.example.demo.mapper")

启动启动类,就可以正常运行了。

常见的问题:

   Consider defining a bean of type 'com.example.demo.mapper.RoleAuthorityMapper' in your configuration.

参考 条目 6.

 

 

 

  相关解决方案