SprigBoot学习踩坑总结
pom.xml文件中显示红色字体,信息为:Dependency 'XXXX' not found
target下没有Mapper.xml和application.yml
在pom的build节点配置以下内容
<resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.yml</include> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.yml</include> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources>
SQLiteDataSource配置
spring:
datasource:
url: jdbc:sqlite:D:/Java/Sqlite/ltqschool.db
driver-class-name: org.sqlite.JDBC
mybatis配置
###################################### MyBatis 配置######################################
mybatis:
# 指定 mapper.xml 的位置
mapper-locations: classpath:com/example/demo/mapper/*.xml
#扫描实体类的位置,在此处指明扫描实体类的包,在 mapper.xml 中就可以不写实体类的全路径名
type-aliases-package: com.example.demo.dao
configuration:
#默认开启驼峰命名法,可以不用设置该属性
map-underscore-to-camel-case: true
Idea 快速生成Getter和Setter