项目打包发布到tomcat中,中文出现乱码

时间:2022-07-25 21:29:09

先吐槽一下,花了我3个小时,心累

本地运行正常,发布时maven插件里要加utf-8编码

https://blog.csdn.net/testcs_dn/article/details/45583791

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<encoding>utf-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>