Spring Boot后台脚手架搭建 [三] 基础配置

框架的一些基础配置

1、pom文件



	4.0.0

	com.ycyun
	admin
	1.0

	
		org.springframework.boot
		spring-boot-starter-parent
		2.0.0.RELEASE
	

	
		1.8
		2.8.0
		23.0
		1.2.46
		1.1.8
		3.17
		0.9.0
		1.3.1
	

	
		
			org.springframework.boot
			spring-boot-starter-test
			test
		
		
			org.springframework.boot
			spring-boot-starter-aop
		
		
			org.springframework.boot
			spring-boot-starter-actuator
		
		
			com.google.guava
			guava
			${google.guava}
		
		
			org.apache.commons
			commons-lang3
		
		
		
			com.fasterxml.jackson.core
			jackson-databind
		
		
			com.fasterxml.jackson.core
			jackson-annotations
		
		
			commons-codec
			commons-codec
		
		
			com.alibaba
			fastjson
			${fastjson.version}
		
		
			org.springframework.boot
			spring-boot-starter-web
		
		
			org.springframework.boot
			spring-boot-starter-security
		
		
			org.mybatis.spring.boot
			mybatis-spring-boot-starter
			${mybatis.version}
		
		
			mysql
			mysql-connector-java
			runtime
		
		
			com.alibaba
			druid
			${druid.version}
		
		
		
			log4j
			log4j
			1.2.17
		
		
			io.springfox
			springfox-swagger2
			${swagger.version}
		
		
			io.springfox
			springfox-bean-validators
			${swagger.version}
		
		
			io.springfox
			springfox-swagger-ui
			${swagger.version}
		

		
			org.springframework.boot
			spring-boot-starter-data-redis
		
        

		
			org.springframework
			spring-context-support
		
		
			org.apache.poi
			poi
			${poi.version}
		
		
			io.jsonwebtoken
			jjwt
			${jwt.version}
		
	


	
		
			
				org.springframework.boot
				spring-boot-maven-plugin
			
		
	

2、application.yml

spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/ycyun?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
    username: root
    password: 123456
    initialSize: 5
    minIdle: 5
    maxActive: 20
    maxWait: 60000
    timeBetweenEvictionRunsMillis: 60000
    minEvictableIdleTimeMillis: 300000
    validationQuery: SELECT 1
    testWhileIdle: true
    testOnBorrow: true
    testOnReturn: false
    poolPreparedStatements: true
    maxPoolPreparedStatementPerConnectionSize: 20
    filters: stat,wall,log4j
    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
  jackson:
    date-format: yyyy-MM-dd HH:mm:ss
    joda-date-time-format: yyyy-MM-dd HH:mm:ss
    time-zone: GMT+8
  servlet:
    multipart:
      max-file-size: 100MB
      max-request-size: 100MB
  mvc:
    servlet:
      load-on-startup: 1
  redis:
    host: localhost
    port: 6379

mybatis:
  type-aliases-package: com.boot.security.server.model
  mapper-locations: classpath:/mybatis-mappers/*
  configuration:
    mapUnderscoreToCamelCase: true
files:
  path: ${file-path:d:/files}
logging:
  config: classpath:logback-admin.xml
log:
  level:
    root: info
    my: debug
  file: logs/admin-server.log
  maxsize: 30MB
token:
  expire:
    seconds: 7200
  jwtSecret: (XIAO:)_$^11244^%$_(WEI:)_@@++--(LAO:)_++++_.sds_(SHI:)
server:
  port: 8080

3、logback-admin.xml



	
	
	
	

	
		
			%d [%thread] %-5level %logger{50} -[%file:%line]- %msg%n
			
			UTF-8
		
	

	
		${logFile}
		
			%d [%thread] %-5level -[%file:%line]- %msg%n
			
			UTF-8
		
		
			${logFile}.%d{yyyy-MM-dd}.%i
			${maxFileSize}
		
	

	
		${logFile}.error
		
			%d [%thread] %-5level %logger{36} -[%file:%line]- %msg%n
			
			UTF-8
		
		
			${logFile}.error.%d{yyyy-MM-dd}.%i
			${maxFileSize}
		
		
			error
			ACCEPT
			DENY
		
	

	
		${logFile}.sql
		
			%d [%thread] %msg%n
			
			UTF-8
		
		
			${logFile}.sql.%d{yyyy-MM-dd}.%i
			${maxFileSize}
		
	

	
		
	

	
		
	

	
		
		
	

关于sl4j的基础配置可以看这篇博客 点击打开链接


你可能感兴趣的:(Spring,Boot后台脚手架搭建,spring,boot学习)