Skip to content

Maven

Maven的settings.xml 配置阿里云镜像源

xml
<mirrors>
    <mirror>
        <id>aliyunmaven</id>
        <name>阿里云公共仓库</name>
        <url>https://maven.aliyun.com/repository/public</url>
        <mirrorOf>central</mirrorOf> <!-- 表示代替中央仓库 -->
    </mirror>
</mirrors>

application.yml

yml

server:
  port: 8080
  servlet:
    context-path: /api

spring:
  application:
    name: my-service
  datasource:
    url: jdbc:mysql://localhost:3306/db_name?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
    username: root
    password: 123456
    driver-class-name: com.mysql.cj.jdbc.Driver
    hikari:
      maximum-pool-size: 20

mybatis:
  mapper-locations: classpath:mapper/*.xml
  configuration:
    map-underscore-to-camel-case: true # 开启驼峰命名自动映射

logging:
  level:
    root: INFO
    com.example.demo: DEBUG
  file:
    name: logs/app.log