Spring boot pom 配置集合
< project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
< modelVersion >4.0.0
< parent >
< groupId >org.springframework.boot
< artifactId >spring-boot-starter-parent
< version >2.7.5
< relativePath />
< groupId >com.example
< artifactId >daytask
< version >0.0.1-SNAPSHOT
< name >com.daytask
< description >com.daytask
< properties >
< java.version >1.8
< dependencies >
< dependency >
< groupId >org.springframework.boot
< artifactId >spring-boot-starter-mail
< dependency >
< groupId >org.springframework.boot
< artifactId >spring-boot-starter-validation
< dependency >
< groupId >org.springframework.boot
< artifactId >spring-boot-starter-web
< dependency >
< groupId >org.mybatis.spring.boot
< artifactId >mybatis-spring-boot-starter
< version >2.2.2
< dependency >
< groupId >org.springframework.boot
< artifactId >spring-boot-devtools
< scope >runtime
< optional >true
< dependency >
< groupId >mysql
< artifactId >mysql-connector-java
< scope >runtime
< dependency >
< groupId >org.springframework.boot
< artifactId >spring-boot-starter-test
< scope >test
< dependency >
< groupId >com.alibaba
< artifactId >druid
< version >1.1.10
< dependency >
< groupId >commons-fileupload
< artifactId >commons-fileupload
< version >1.3.1
< dependency >
< groupId >commons-lang
< artifactId >commons-lang
< version >2.5
< dependency >
< groupId >com.alibaba
< artifactId >easyexcel
< version >2.2.6
< dependency >
< groupId >ws.schild
< artifactId >jave-all-deps
< version >2.5.1
< dependency >
< groupId >com.baomidou
< artifactId >mybatis-plus-boot-starter
< version >3.4.1
< dependency >
< groupId >org.projectlombok
< artifactId >lombok
< version >1.18.4
< scope >provided
< build >
< plugins >
< plugin >
< groupId >org.springframework.boot
< artifactId >spring-boot-maven-plugin
server.port=8087 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.username=root spring.datasource.password=123456 spring.datasource.url=jdbc:mysql://localhost:3306/mybatis?serverTimezone=GMT%2B8 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.initialSize=5 spring.datasource.minIdle=5 spring.datasource.maxActive=20 spring.datasource.maxWait=60000 spring.datasource.timeBetweenEvictionRunsMillis=60000 spring.datasource.minEvictableIdleTimeMillis=300000 spring.datasource.validationQuery=SELECT 1 FROM DUAL spring.datasource.testWhileIdle=true spring.datasource.testOnBorrow=false spring.datasource.testOnReturn=false spring.datasource.poolPreparedStatements=true #这里是mysql中的时间切换 spring.jackson.date-format=yyyy-MM-dd spring.jackson.time-zone=GMT+8 spring.jackson.serialization.write-dates-as-timestamps=false #查看mybatis sql语句 mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl #开启mysql 字段_自动映射到java驼峰标记上面 java驼峰的属性自动写到mysql中的下划线 mybatis.configuration.map-underscore-to-camel-case=true
如果在spring boot 里使用mybatis映射,要在application.properties 加上以下两条
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.type-aliases-package=com.example.demo.entity

浙公网安备 33010602011771号