#Profile配置 spring.profiles.active=dev #Mybatis 配置 mybatis.mapper-locations=classpath:mapper/*.xml
#配置端口号 server.port=8082 #连接数据库的配置参数 spring.datasource.password=123456 spring.datasource.username=root spring.datasource.url=jdbc:mysql://localhost:3306/bbsdb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # 日志的显示级别 logging.level.cn.com.demo=trace
#配置静态资源文件夹 classpath:static指原来的static文件夹 spring.web.resources.static-locations=file:g:/files,classpath:static #设置上传文件大小 默认1MB spring.servlet.multipart.max-file-size=10MB #配置Mybatis书写SQL语句的xml文件的位置 mybatis.mapper-locations=classpath:mappers/*xml
<?xml version="1.0" encoding="UTF-8"?> <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</modelVersion> <!-- 父级项目版本 --> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.9</version> <relativePath/> <!-- lookup parent from repository --> </parent> <!-- 当前项目的信息 --> <groupId>cn.com</groupId> <artifactId>demo</artifactId> <version>0.0.1</version> <!-- 属性配置 --> <properties> <java.version>1.8</java.version> </properties> <!-- 当前项目的依赖项 --> <!-- scope属性值为test:此依赖项仅用于测试,仅src/test下的代码可使用此依赖项,且此依赖项不参与项目打包、部署等 --> <!-- scope属性值为runtime:此依赖项仅运行或测试运行时需要,编写代码时并不需要此依赖项 --> <dependencies> <!-- Spring Boot WEB的依赖项 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- Spring Boot Validation的依赖项,用于检查请求参数的基本格式 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> <!-- Spring Boot Security的依赖项,用于处理认证与授权 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <!-- Spring Boot Data Redis的依赖项,用于实现Redis编程 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!-- Spring Boot AOP的依赖项 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> <!-- Mybatis整合Spring Boot的依赖项 --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.2.2</version> </dependency> <!-- MySQL的依赖项 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <!-- Knife4j Spring Boot:在线API --> <dependency> <groupId>com.github.xiaoymin</groupId> <artifactId>knife4j-spring-boot-starter</artifactId> <version>2.0.9</version> </dependency> <!-- fastjson:实现对象与JSON的相互转换 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.75</version> </dependency> <!-- JJWT(Java JWT) --> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt</artifactId> <version>0.9.1</version> </dependency> <!-- Lombok的依赖项,主要用于简化POJO类的编写 --> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.20</version> <scope>provided</scope> </dependency> <!-- Spring Boot测试的依赖项 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>