Skip to content

Commit fc9b169

Browse files
juzi214032colorful3
authored andcommitted
chore(pom): 为 Maven 指定 file.encoding 参数,解决运行 mvn test 报错问题
因为在 application.properties 中指定了 spring.mandatory-file-encoding=UTF-8,FileEncodingApplicationListener 类检测到当前系统编码与 mandatory-file-encoding 不一致的情况下会报错
1 parent b7e453d commit fc9b169

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

pom.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<description>Demo project for lin cms</description>
1717

1818
<properties>
19+
<argLine>-Dfile.encoding=UTF-8</argLine>
1920
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2021
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
2122
<java.version>1.8</java.version>
@@ -54,11 +55,6 @@
5455
<artifactId>spring-boot-starter-aop</artifactId>
5556
</dependency>
5657

57-
<dependency>
58-
<groupId>org.springframework.boot</groupId>
59-
<artifactId>spring-boot-starter-jdbc</artifactId>
60-
</dependency>
61-
6258
<!--MySQL JDBC驱动-->
6359
<dependency>
6460
<groupId>mysql</groupId>
@@ -116,6 +112,12 @@
116112
<version>${mybatis-plus.version}</version>
117113
<scope>test</scope>
118114
</dependency>
115+
116+
<dependency>
117+
<groupId>org.springframework.boot</groupId>
118+
<artifactId>spring-boot-configuration-processor</artifactId>
119+
<optional>true</optional>
120+
</dependency>
119121
</dependencies>
120122

121123
<build>

0 commit comments

Comments
 (0)