1. 配置YML源
配置spring
spring:
application:
name: item-service #项目名
配置Mybatis
配置数据源
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/库名?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
username: root
password: root
项目忽略Mybatis源
@SpringBootApplication(exclude=DataSourceAutoConfiguration.class)
配置mybatis映射文件
mybatis:
mapper-locations:
- classpath:/mapper/*/*.xml
配置Mybatis Plus
#mybatis-plush配置
mybatis-plus:
type-aliases-package: com.jt.pojo #映射对象
mapper-locations: classpath:/mybatis/mappers/*.xml
configuration:
map-underscore-to-camel-case: true
配置MVC
spring: #定义springmvc视图解析器
mvc:
view:
prefix: /WEB-INF/views/
suffix: .jsp
配置server
server:
port: 8094 #端口信息
servlet:
context-path: /
配置tomcat
server:
tomcat:
max-threads: 256
min-spare-threads: 5
配置日志
#log
logging:
level:
com.cy: debug
配置shrio
shiro:
loginUrl: /doLoginUI
web:
enabled: true
sessionManager:
sessionIdCookieEnabled: true
sessionIdUrlRewritingEnabled: false
rememberMeManager:
cookie:
name: rememberMe
maxAge: 3600
2. jar包管理
1. properties
<properties>
<!--指定JDK版本 -->
<java.version>1.8</java.version>
<!--指定maven插件版本